[SOLVED] Icons are not visible when i run the application.
-
I have created the Qt resource file, and added some icons (jpg,png) to it and saved it
In the designer, i have added a pushbutton, and changed it's icon to one from the resources filesBut when i run the application no icons appear...
edit: Qt 5.02 on windows 8 -
For jpg, you need the appropriate imageformat plugin to be present. Otherwise: check your paths. Are you sure that in your application the images come from the resources, and not from the file system?
-
[quote author="Andre" date="1371126946"]For jpg, you need the appropriate imageformat plugin to be present. Otherwise: check your paths. Are you sure that in your application the images come from the resources, and not from the file system?[/quote]
i got the same problem on jpg and png.
The pictures are located at
Project folder/Pictures/Subfolder
I have added a new resource file via right click on project->add new
After that i created the pushbutton and changed the iconIn other words i can see the icon when i am on the designer but when i execute it i don't
-
What path are you using to load the icons?
-
[quote author="Andre" date="1371127662"]What path are you using to load the icons?[/quote]
That's what i am trying to tell you this whole time :D
I am using the designer to set the icons -
The solution is find and put the folder "imageformats" in the same folder of the app .
or in the system32 folder, and add these lines in main.cpp.
@ifdef Q_OS_WIN32
QString env = getenv ("SYSTEMROOT");
#endififdef Q_OS_WIN32
QCoreApplication :: addLibraryPath (env + "\ system32");
endif@
-
That should not be needed for .png files. PNG support is build in, and does not rely on plugins.
-
Must have something to do with Windows.
I am using icons this way 2 years on Qt for Ubuntu... -
Try cleaning the project and running qmake again.Had the same problem a few days ago and it seems that changes to the ressource files were being ignored.
-
[quote author="musimbate" date="1371191557"]Try cleaning the project and running qmake again.Had the same problem a few days ago and it seems that changes to the ressource files were being ignored.
[/quote]Windows sucks balls!
Thank you it worked ;)
-
In this case more likely it is qmake and the makefiles it generates that screw up...
-
Glad it worked for you Leon.
-
Worked for me too. Has anyone filed a bug report yet?
-
[quote author="joshua-anderson" date="1379464605"]Worked for me too. Has anyone filed a bug report yet?[/quote]
there is no similar bug on qt bugreportsso here ya go!
https://bugreports.qt-project.org/browse/QTBUG-33541