(Edit of my previous post is not possible, so this "double post")
What I am doing now to get the "default style" is to ask the QApplication object right after application start for its style before applying a different style.
QString defaultStyleName
= qApp
->style
()->objectName
();
qApp->setStyle(/*e.g. Plastique style*/);
// much more code follows and later I want to switch to the default style:
QString defaultStyleName = qApp->style()->objectName();
qApp->setStyle(/*e.g. Plastique style*/);
// much more code follows and later I want to switch to the default style:
qApp->setStyle(QStyleFactory::create(defaultStyleName));
To copy to clipboard, switch view to plain text mode
But this approach fails if someone start teh application with the commandline option -style=<someStyle>. Then my defaultStyleName string would be <someStyle> and NOT the default style Qt uses for the underlaying operating system.
How can the system's default style be determined?
Bookmarks