diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-02 17:09:52 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-02 17:13:14 (GMT) |
commit | fb5790e1b1d4ddeac19a2996c806744509de4ac8 (patch) | |
tree | c6721f1aa89a5e1bf082b3ae1a9b1836cc7a6930 | |
parent | 7c09fda559760b8488d3130a5932fee04b2f6979 (diff) | |
download | Qt-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
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 6 |
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 = |