[Solved] Problem displaying pictures in different environment(in another computer)
-
Hi,
I have wrote a program, It use QMovie to display a GIF picture and it work well in my computer. When I send this binary to my friend, and execute it on his computer, the picture is missing(just missing, but all other function still works well)
I believe the source code is fine, because I can run this program. I am sure that picture file (.GIF) is in the correct path. I have no idea why the picture just can not be displayed. Does anyone met this problem before?
-
What does
@QImageReader::supportedImageFormats();@
output on your and on the other computer? -
Sounds like you did not distribute the image plugins of Qt to your friend.
-
I tried to install Qt SDK on my friend's computer, and it worked.
The output of QImageReader::supportedImageFormats() on my computer is:
bmp
gif
ico
jpeg
jpg
mng
pbm
pgm
png
ppm
svg
svgz
tga
tif
tiff
xbm
xpmbut on my friend's computer, it is:
bmp
pbm
pgm
png
ppm
xbm
xpmMy picture format is GIF, it is not on the list shown above.
There is some tutorial resource:
http://qt-project.org/doc/qt-4.8/deployment-windows.htmlAfter put the plugin dll to the correct path. Now it works for all computers with no Qt SDK installation. Thank you for your kindly help.
I have one last question. How can I know which plugin I should pack before deploying to another computer? Is there any tool or something which can provide clue to find the which plugin was missing?
-
The only thing I can say is: test. Qt loads all plugins it finds at initialization, so you can't use a tool like dependency walker.