How do I change the background colour of the QWidget in a QStackedWidget using Qt css?
ProjectPage* p = new ProjectPage(this);
ui.stackedWidget->addWidget(p);
My ProjectPage is a custom QWidget built in the Qt designer. Currently I tried changing the background color of ProjectPage in the designer and that has failed to work. It’s a failure because the color of the background when displayed in my application is the default color I set all QWidget using the css, the only exception is all labels and buttons on my ProjectPage had their colour changed.
I’m currently unable to find the QstackedWidget css documentation.
Note: background images work fine, I’m exploring the possibility that this is related to me having set a default image for all QWidgets.
My issue is caused by using the css code below.
By defining a default texture all background colour you set becomes hidden behind this texture.
The solution is to remove the default texture from
QWidgetor load a new texture with the colour you need.