I would like to show a .gif animation in a QLabel widget, alongside text.
The following code won’t work:
self.status_txt = QtGui.QLabel('Loading... <img src="etc/loading.gif">')
as the image won’t animate.
I tried achiving it by using a QMovie object:
self.status_txt = QtGui.QLabel("Loading...")
movie = QtGui.QMovie("etc/loading.gif")
self.status_txt.setMovie(movie)
movie.start()
But then I can’t put the animation and the text together.
Is there a different solution besides using two different labels?
you can add a Layout to the label, and then add another Label with the text to that…
edit:
it’s possible if you use your own version of a QLabel and a QPainter to paint the text yourself: