[SOLVED] Icons are not visible when i run the application.
-
wrote on 13 Jun 2013, 12:33 last edited by
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 -
wrote on 13 Jun 2013, 12:35 last edited by
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?
-
wrote on 13 Jun 2013, 12:41 last edited by
[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
-
wrote on 13 Jun 2013, 12:47 last edited by
What path are you using to load the icons?
-
wrote on 13 Jun 2013, 13:00 last edited by
[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 -
wrote on 13 Jun 2013, 13:34 last edited by
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@
-
wrote on 13 Jun 2013, 13:37 last edited by
That should not be needed for .png files. PNG support is build in, and does not rely on plugins.
-
wrote on 13 Jun 2013, 13:43 last edited by
Must have something to do with Windows.
I am using icons this way 2 years on Qt for Ubuntu... -
wrote on 14 Jun 2013, 06:32 last edited by
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.
-
wrote on 14 Jun 2013, 12:42 last edited by
[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 ;)
-
wrote on 14 Jun 2013, 12:54 last edited by
In this case more likely it is qmake and the makefiles it generates that screw up...
-
wrote on 16 Jun 2013, 07:41 last edited by
Glad it worked for you Leon.
-
wrote on 18 Sept 2013, 00:36 last edited by
Worked for me too. Has anyone filed a bug report yet?
-
wrote on 18 Sept 2013, 10:49 last edited by
[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