Throbber transparency with QToolbar
-
Hi,
I'm trying to add an animated gif on a QToolbar()
Almost work, doing that:mov = QMovie("waiting.gif", parent=self) lbl = QLabel(self) mov.setScaledSize(QSize(32, 32)) lbl.setMovie(mov) lbl.setAttribute(Qt.WidgetAttribute.WA_NoSystemBackground) lbl.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground) my_toolbar.addWidget(lbl) mov.start()
But, doesn't work, the background remains black !!
Perhaps something to do/change with the gif itself ?
Any ideas ?
Thanks for you help -
@stef-pellegrino said in Throbber transparency with QToolbar:
mov = QMovie("waiting.gif", parent=self)
You are using a relative path to the image: are you sure your app can find it at runtime?
You should put it into a resource: https://doc.qt.io/qt-6/resources.html -
@stef-pellegrino Well let's start with: does the GIF have a background?
-
@JonB Hi,
Ok, sorry for wasting your time, the gif "transparent region" was setting on black, I changed it to "white" and it works !
Nevertheless Don't really know why !? (I need some tutorials about gif transparency I guess :))