Set QStackedWidget Background color?
-
wrote on 19 Apr 2019, 05:44 last edited by
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.
-
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.
wrote on 19 Apr 2019, 05:56 last edited by KillerSmathYou can use apply the style in QWidgets inside a QStackedWidgets (Child)
Css Selector [>]QStackedWidget > QWidget{ background: #ff0000; }
-
You can use apply the style in QWidgets inside a QStackedWidgets (Child)
Css Selector [>]QStackedWidget > QWidget{ background: #ff0000; }
wrote on 19 Apr 2019, 06:02 last edited by@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.
-
wrote on 19 Apr 2019, 06:05 last edited by
Nevermind.
In case anyone else is interested: Explanation here
-
@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.
wrote on 19 Apr 2019, 06:09 last edited by@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 :)
4/5