View Full Version : QMovie supports no animation formats (PyQt on Windows)

4th May 2009, 23:13
I am using PyQt GPLv4.4.3 for Python v2.5 on a Windows machine and am having trouble getting QMovie to support gif animations. The problem is that the function call QMovie.supportedFormats() returns an empty list (on Windows). But, on a Mac it returns the list [PyQt4.QtCore.QByteArray('gif'), PyQt4.QtCore.QByteArray('mng')]. So, I am unable to play gif animations using PyQt in Windows using QMovie.


from PyQt4.QtGui import QMovie

On the QImageReader page ( http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qimagereader.html#supportedImageFormats <http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qimagereader.html#supportedImageFormats> ) it says that "To configure Qt with GIF support, pass -qt-gif to the configure script or check the appropriate option in the graphical installer."

So, I have tried things such as re-building Qt with the -qt-gif option, re-installing PyQt with all installation options selected, and installing newer versions of Python, PyQt, and SIP, but have been unsuccessful.

Is there some way to configure PyQt with Windows so that QMovie will support some sort of animation? (if it was not configured that way by default)
Any help would be very much appreciated. Thanks in advance.

4th May 2009, 23:38
Are you sure your PyQt uses the version of Qt that you compiled yourself (the one with -qt-gif)? Also check if the GIF plugin was compiled and is available in $QTDIR/plugins/imageformats. It should be called qgif.dll or something like that.

5th May 2009, 00:38
The qgif4.dll file does exist in $QTDIR/plugins/imageformats (C:\Qt\2009.02\qt\plugins\imageformats), so it seems that the GIF plugin was compiled and is available.

I also found the file in another location: C:\Python25\Lib\site-packages\PyQt4\plugins\imageformats

However, I am not sure PyQt is using the version of Qt that I compiled myself (the one with -qt-gif). How would I make sure that PyQt is using the version of Qt that I compiled myself?


5th May 2009, 09:44
It probably doesn't. The version of Qt bundled with Creator is 4.5 while your PyQt uses 4.4 so there is a good chance they are incompatible. You either need to build the plugin for 4.4 or you need to install/build PyQt for 4.5.