On Wed, 13 Aug 2008 12:05:12 +0200, Sven Grunewaldt <[EMAIL PROTECTED]> wrote: > Hi, > > I want to display an image in a QLabel and while downloading it, I want > to display the usual nice ajax gif. > After a little bit of searching around I found QMovie(), but whenever I > apply it to a QLabel I get a runtime error on the pythonw.exe :( > > I got the loading gif from http://www.ajaxload.info/ and attached it to > the email. > > Code: > import sys > from PyQt4.QtGui import * > > app = QApplication(sys.argv) > > label = QLabel("Test", None) > > gif = QMovie() > gif.setFileName("test.gif") > img = QImage() > img.load("test.gif") > > # Causes runtime error > # label.setMovie(gif) > > # Works, but is not animated > label.setPixmap(QPixmap.fromImage(img)) > > label.show() > app.exec_()
Works fine for me, if you add the missing gif.start(), and your Qt has GIF support. Phil _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
