Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using Qt Designer 4.8.4 and I include two files in the QMainWindow resource file: a .ico file and a .gif file. When loading from code using:

QPixmap p;
p.load(":/MyApp/media/logo.gif");  // does work
p.load(":/MyApp/media/logo.ico");  // does not work

The gif file works, but not the ico file. Is there any reason? I am using the ico file as the window icon and it is not showing when running the application.

And, YES, I am successfully compiling the qrc file since the GIF file is working.

Cheers,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
459 views
Welcome To Ask or Share your Answers For Others

1 Answer

*.ico is not supported.

By default, Qt supports the following formats:

Format Description Qt's support

BMP Windows Bitmap Read/write

GIF Graphic Interchange Format (optional) Read

JPG Joint Photographic Experts Group Read/write

JPEG Joint Photographic Experts Group Read/write

PNG Portable Network Graphics Read/write

PBM Portable Bitmap Read

PGM Portable Graymap Read

PPM Portable Pixmap Read/write

TIFF Tagged Image File Format Read/write

XBM X11 Bitmap Read/write

XPM X11 Pixmap Read/write


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...