Tuesday, 20 August 2013

Why do stylesheets not work when subclassing QWidget and using Q_OBJECT?

Why do stylesheets not work when subclassing QWidget and using Q_OBJECT?

Case 1: Create subclass of QWidget with Q_OBJECT and set stylesheet -- no
effect.
Case 2: Create subclass of QWidget without Q_OBJECT and set stylesheet --
works as expected
Case 3: Create subclass of QLabel with Q_OBJECT and set stylesheet --
works as expected
How to understand this behavior? Is it possible to make stylesheets work
in the case 1?

No comments:

Post a Comment