1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Added hack to fix QT_STYLE_OVERRIDE with QProxyStyle

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
This commit is contained in:
David Rosca 2014-05-28 23:02:28 +02:00
parent 7fc0c8d06d
commit 7a1f4c77cd

View File

@ -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())