summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2016-02-05 14:56:06 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2016-04-18 09:51:11 +0000
commit4d10e55d4d666f5557a51d43a1bd4b1f172829ac (patch)
tree525d767f7b49cb51c9ea88e0261ef73b0fd9890a /src/widgets
parent4c6b0cf5d53a4d1880f5089df967bf4e6e4c4283 (diff)
Fix detection of the proxy base style when QT_STYLE_OVERRIDE is set
QProxyStyle checks QApplicationPrivate::styleOverride but ignores QT_STYLE_OVERRIDE when it is trying to detect the name of the base style. Set styleOverride from QT_STYLE_OVERRIDE to make it work. Thus there is no need to check QT_STYLE_OVERRIDE from multiple places. Change-Id: I2a64b5ff5443701f800ef5d2a9cb425068f909f1 Task-number: QTBUG-52596 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qapplication.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index b34380dbc3..a459a57482 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -464,6 +464,9 @@ QDesktopWidget *qt_desktopWidget = 0; // root window widgets
*/
void QApplicationPrivate::process_cmdline()
{
+ if (styleOverride.isEmpty() && qEnvironmentVariableIsSet("QT_STYLE_OVERRIDE"))
+ styleOverride = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
+
if (!styleOverride.isEmpty()) {
if (app_style) {
delete app_style;
@@ -1120,11 +1123,8 @@ QStyle *QApplication::style()
// Compile-time search for default style
//
QString style;
- QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
if (!QApplicationPrivate::styleOverride.isEmpty()) {
style = QApplicationPrivate::styleOverride;
- } else if (!envStyle.isEmpty()) {
- style = envStyle;
} else {
style = QApplicationPrivate::desktopStyleKey();
}