[solved] Images Not Showing in Deployment.
I have developed a small application which has some images on its UI. The images look fine during designing and previewing the form but when I run the application, images don’t show..
Please help me in this regard.
I created a resource file and added images to it, then used from there but it’s not displaying images.
I am using QT SDK 1.1
Does your application show images if you load them from disk or from the web?
If not, then your problem is the distribution of your image plugins. If it does, then the problem is with the way you address your image files.
You don’t use signals and slots to “connect” a resource file to anything. A resource file provides a virtual file system that you can use from inside your Qt application for read-only access to your resource files. You can create such a file from Qt Creator using CTRL+N, choosing the Qt option in the bottom left list, and “Qt Resource file” from the list on the right. Files you add are accessible using the normal Qt classes (almost everywhere Qt accepts a file name) by starting the file name with “:/”.
- QImage myImage(":/images/myImage.png");
The above would load an image from the resources that was stored under the “images” directory in the resource.
Signals and slots can in a limited way be connected through the designer interface of Qt Creator. Only signals and slots inside the form you are creating (that is, between the widgets that you have put on the form) can be connected. For other signals and slots, you need to make the connections in code.