Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Commit

Permalink
Added hack to fix QT_STYLE_OVERRIDE with QProxyStyle
Browse files Browse the repository at this point in the history
Forcing a widget style with QT_STYLE_OVERRIDE env variable does
not work when the app is using a QProxyStyle.
Manually appending the -style=$QT_STYLE_OVERRIDE to command line
arguments workarounds the issue.

Closes #1357
  • Loading branch information
nowrep committed May 28, 2014
1 parent 7fc0c8d commit 7a1f4c7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ int main(int argc, char* argv[])
signal(SIGSEGV, qupzilla_signal_handler);
#endif

// Hack to fix QT_STYLE_OVERRIDE with QProxyStyle
const QByteArray style = qgetenv("QT_STYLE_OVERRIDE");
if (!style.isEmpty()) {
char **args = (char**) malloc(sizeof(char*) * (argc + 1));
for (int i = 0; i < argc; ++i)
args[i] = argv[i];

QString stylecmd = QL1S("-style=") + style;
args[argc++] = qstrdup(stylecmd.toUtf8().constData());
argv = args;
}

MainApplication app(argc, argv);

if (app.isClosing())
Expand Down

0 comments on commit 7a1f4c7

Please sign in to comment.