Reputation: 11
I need to change between two styles in my app: custom, stylesheet and default one. I tried to change it by:
qApp->setStyle(new QCleanlooksStyle);
but it doesn't change the colors, images, etc.
Upvotes: 1
Views: 4332
Reputation: 440
You can invoke setStyleSheet
with an empty string.
qApp->setStyleSheet( "" );
Upvotes: 4
Reputation: 17535
Setting the style and setting the stylesheet are two different things.
If you have an application-wide stylesheet, that is, you called QApplication::setStyleSheet(), then you'll need to clear it for your setStyle() function to really have any effect:
qApp->setStyleSheet( QString() );
If, on the other hand, you have random bits of style set on your individual widgets, then you'll probably have to migrate to a global style sheet first.
Upvotes: 3