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,
*.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
Because QPixmap Cant read .ico files simply, take a look at documentation QPixmap if you want to know more about formats supported
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With