Details
-
Suggestion
-
Resolution: Fixed
-
Not Evaluated
-
4.7.2
-
None
Description
If you want to save the current QStyle of your Application to the Settings you have to use something like this:
QStyle *style = qApp->style(); QString styleKey; if(dynamic_cast<MyStyle*>(style) != NULL) styleKey = "MyStyle"; else if(dynamic_cast< QPlastiqueStyle*>(style) != NULL) styleKey = "Plastique"; else if(dynamic_cast<QWindowsXPStyle*>(style) != NULL) styleKey = "WindowsXP"; [...] settings.setValue("WidgetStyle",styleKey);
It would be nice to have a member function (eg. virtual QString key()) which will return the key identical to the QStyleFactor::keys() function.
So you only have to call QString styleKey = qApp->style()->key(); to get the key.
And simply with QStyleFactor::create(key) you can restore
Attachments
Issue Links
- duplicates
-
QTBUG-8004 QProxyStyle: When setting a style that is a subclass of QProxyStyle on a widget, then this will have the effect of influencing other widgets using that same base style
- Closed