summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-04-02 17:09:52 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-04-02 17:13:14 (GMT)
commitfb5790e1b1d4ddeac19a2996c806744509de4ac8 (patch)
treec6721f1aa89a5e1bf082b3ae1a9b1836cc7a6930 /src/gui/kernel
parent7c09fda559760b8488d3130a5932fee04b2f6979 (diff)
downloadQt-fb5790e1b1d4ddeac19a2996c806744509de4ac8.zip
Qt-fb5790e1b1d4ddeac19a2996c806744509de4ac8.tar.gz
Qt-fb5790e1b1d4ddeac19a2996c806744509de4ac8.tar.bz2
Only set system style when it actually changes
This issue would cause Qt Creator and similar apps with proxy styles to loose their custom styling whenever any x11 system settings changed. This happened because we would re-read the settings and override the system style even if the system style did not actually change would be set on the application. We Task-number: 250199 Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 6babda9..260a9a4 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -887,11 +887,15 @@ bool QApplicationPrivate::x11_apply_settings()
}
}
+ static QString currentStyleName = stylename;
if (QCoreApplication::startingUp()) {
if (!stylename.isEmpty() && !QApplicationPrivate::styleOverride)
QApplicationPrivate::styleOverride = new QString(stylename);
} else {
- QApplication::setStyle(stylename);
+ if (currentStyleName != stylename) {
+ currentStyleName = stylename;
+ QApplication::setStyle(stylename);
+ }
}
int num =