diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-11 14:58:22 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-13 14:58:11 +0000 |
commit | 6f84d50457ad6c8864e776fc722895458350c2e1 (patch) | |
tree | a1a206396656357592702f1871b192c03035d3f7 /src/widgets/kernel | |
parent | bee361209f82425e6727a96c210ec6abf76b4bff (diff) |
move styleOverride from QApplicationPrivate to QGuiApplicationPrivate
* -style option is also used in other cases than widget world
Change-Id: I8555d309a7b9df0d26ad7a7b930411260537180e
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 21 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 2 |
2 files changed, 7 insertions, 16 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 148ed61424..29bff8227f 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -398,8 +398,6 @@ void qt_cleanup(); QStyle *QApplicationPrivate::app_style = 0; // default application style bool QApplicationPrivate::overrides_native_style = false; // whether native QApplication style is // overridden, i.e. not native -QString QApplicationPrivate::styleOverride; // style override - #ifndef QT_NO_STYLE_STYLESHEET QString QApplicationPrivate::styleSheet; // default application stylesheet #endif @@ -465,6 +463,13 @@ QDesktopWidget *qt_desktopWidget = 0; // root window widgets */ void QApplicationPrivate::process_cmdline() { + if (!styleOverride.isEmpty()) { + if (app_style) { + delete app_style; + app_style = 0; + } + } + // process platform-indep command line if (!qt_is_gui_used || !argc) return; @@ -480,13 +485,8 @@ void QApplicationPrivate::process_cmdline() QByteArray arg = argv[i]; if (arg.startsWith("--")) arg.remove(0, 1); - QString s; if (arg == "-qdevel" || arg == "-qdebug") { // obsolete argument - } else if (arg.indexOf("-style=", 0) != -1) { - s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower()); - } else if (arg == "-style" && i < argc-1) { - s = QString::fromLocal8Bit(argv[++i]).toLower(); #ifndef QT_NO_STYLE_STYLESHEET } else if (arg == "-stylesheet" && i < argc -1) { styleSheet = QLatin1String("file:///"); @@ -500,13 +500,6 @@ void QApplicationPrivate::process_cmdline() } else { argv[j++] = argv[i]; } - if (!s.isEmpty()) { - if (app_style) { - delete app_style; - app_style = 0; - } - styleOverride = s; - } } if(j < argc) { diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index ba8d7ff63c..75d86a5eba 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -219,8 +219,6 @@ public: static QApplicationPrivate *instance() { return self; } - static QString styleOverride; - #ifdef QT_KEYPAD_NAVIGATION static QWidget *oldEditFocus; static Qt::NavigationMode navigationMode; |