QLabel cannot display image on other computer
I wrote a small program to show images on a QLabel, which is the central widget of the mainwindow.
The program works fine on my computer, it is the developing machine, with windows 7, vs 2008 and QT 4.6.3
But after i deployed my program to other computer with (all files are in the same folder)
the released exe file
the dlls including QtCore4.dll, QtGui4.dll and all the image plugin dlls such as qjpeg4.dll etc.
the visual studio dlls including msvcp90.dll and msvcr90.dll
I started the program on that computer also with windows 7, the mainwindow came, all the actions, gui things worked fine too, but no image can be displayed.
I dont know where the problem is, can somebody help me?
You need to put image plugin in imageformats directory
Do you use a related path for your image or add it to your qrc?
[quote author="cincirin" date="1311764068"]You need to put image plugin in imageformats directory[/quote]
Do that. More info: http://doc.qt.nokia.com/4.7/deployment-plugins.html
I have put the whole imageformats plugin folder, the "imageformats" folder, into the program folder and the problem is solved.
Thank you very much.
p.s.: The images are arbitrary on the harddisk, not included in src. I used a filedialog in code to find the image files.