I have been unable to directly change a style sheet in a class inherited from QWidget, although it works when the class is QWidget. The simplified code that does not work (nothing in constructor):
{
Q_OBJECT
public:
~Banner();
};
banner = new Banner;
banner->setStyleSheet("background-color: rgb(0, 100, 200);");
class Banner : public QWidget
{
Q_OBJECT
public:
Banner(QWidget *parent=0);
~Banner();
};
banner = new Banner;
banner->setStyleSheet("background-color: rgb(0, 100, 200);");
To copy to clipboard, switch view to plain text mode
While this does work:
banner->setStyleSheet("background-color: rgb(0, 100, 200);");
banner = new QWidget;
banner->setStyleSheet("background-color: rgb(0, 100, 200);");
To copy to clipboard, switch view to plain text mode
I'm sure to have missed some understanding here and would appreciate help. Thanks
Bookmarks