Solved Set QStackedWidget Background color?
-
I want to set background color of QStackedWidget to white but the stylesheet isn't taking effect. Also tried applying the stylesheet directly to the page, but that didn't work either.
The only way to get it to work is: QWidget { background-color: white} but that changes background of all controls on the page to white as well.
-
You can use apply the style in QWidgets inside a QStackedWidgets (Child)
Css Selector [>]QStackedWidget > QWidget{ background: #ff0000; }
-
@KillerSmath said in Set QStackedWidget Background color?:
You can use apply the style in QWidgets inside a QStackedWidgets (Child)
Css Selector [>]QStackedWidget > QWidget{ background: #ff0000; }
That worked. Thanks!
Does 'background' and 'background-color' have same effect? I've been using background-color all along.
-
Nevermind.
In case anyone else is interested: Explanation here
-
@Taytoo
Yes same effect.Background is just more generic.
When you set background-color, you are changing just the color of background. But with background tag, you can set more than one setting on background as image, repeat, position, size, in one line :)