Image in ListView don’t work correctly
Hi, I'm experiencing a very strange problem developing a QML application under windows (XP and Win7)
The application was developed under Ubuntu then thanks to QT platform works fine under windows. One of the features of this app is to create a list from xml data (twitter feeds). To be able to deliver the QML program to the users I created a project where main.cpp program work as the launcher of the QML application.
Well, under windows if I start the application with QT ide installed, everything works fine. If I put the compiled program (that has all the needed dll) in a fresh windows xp installation, the application work, but the list shows only the text that is in the delegate while the image icon isn't shown. This problem occours only with the compiled application.
Thank you if you have some idea.
Did you, per chance, forget to install the plugins to handle image file types?
Hi, thankyou for this answer, that opens a new door to my mind... :)
Please, can you explain more in details ? It is possible, but I don't find any about this difference in the QT documentation...
P.S. The problem resides in qml sources of the interface of the app.
How do you know the problem is in the QML sources?
Anyway, look for the topic on "Deploying plugins" in the Qt documentation.
It's the "refrain" of the already opened discussion "Image in ListView don’t work correctly".
The problem happened in the images associated to some text created in a component, then showed in a List View. Initially I though that the problem was in the component or in the list, because theit run only image that wasn't loaded in the app was there.
I tried a lot of tests and changes and finally I found the problem: the REAL difference between the images in the list component and the other images is that these are jpeg while the other are png.
The application works fine with both jpeg and png files while is running in the QT Creator environment (under windows or ubuntu). When I compile the code under windows, jpeg images cant be loaded!!!
The obvious solution had been to convert these jpeg in png format, but this cant explain why does it happens.
All the libraries and components of this app (Mingw, Qt... dlls etc) are set correctly but jpeg images ARE IGNORED by the windows compiled program. Consider that the list management that don't work is not part of the C++ source code but is one of the QML sources. To see the application working I only changed a line of the QML code (.jpg to .png) and substituted the images in the corresponding folder. The compiled program (that work as QML launcher) was not recompiled and all works fine.
Someone has an idea of what I have missed? This workaround solve the problem in this particular case, but it is not a true solution because this means that all my apps that should retrieve a jpg file from the web can evidentiate this problem.
Thank you :)