Animated gif inside QLabel not be drawn transparently
-
I have a QWidget 'A' with a background-image set in its stylesheet - nothing else is drawn on it. On top of the QWidget I have a QLabel widget (children of the 'A') with background set to Transparent. I'm playing an animated gif inside this QLabel using QMovie, the gif itself has transparency (spinner effect).
When I run the application it looks like the spinner is continuously being drawn on itself without background of the parent being re-drawn first? Then I just tried displaying a text in the Label, but even with just text, the background of the parent is Not being drawn. How do I fix these issues?
-
Hi
Make sure your stylesheet doesn't also affect the Label by using
too broad selector.QWidget#centralWidget {
background-image: url(:/garden.jpg);
}Works fine for fast test.
-
I was able to solve the background not drawing issue by painting the jpg manually - I had to do it because I wanted to custom fit the background.
The issue I'm seeing now are the white areas around the edges, as you see in your gif as well. Looks like the edges are not per-pixel alpha-blended with the background?
-
I was able to solve the background not drawing issue by painting the jpg manually - I had to do it because I wanted to custom fit the background.
The issue I'm seeing now are the white areas around the edges, as you see in your gif as well. Looks like the edges are not per-pixel alpha-blended with the background?
-
Found this answer on stackoverflow: https://stackoverflow.com/questions/24592918/gif-image-in-qlabel
Although it was related to Graphics Scene, I tried it out, still no luck :(
-
Found this answer on stackoverflow: https://stackoverflow.com/questions/24592918/gif-image-in-qlabel
Although it was related to Graphics Scene, I tried it out, still no luck :(
-
Hi
Make sure your stylesheet doesn't also affect the Label by using
too broad selector.QWidget#centralWidget {
background-image: url(:/garden.jpg);
}Works fine for fast test.
-
@mrjj How did you made this gif work i'm also using a gif with transparent background but its not working ?
@Sakshi053
Nothing special. JUst using QMovie.
Try the test project and seehttps://www.dropbox.com/s/ebdoleidabqi3ci/stylesheetTest.zip?dl=0