diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-02 00:30:27 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-02 00:30:27 (GMT) |
commit | 737b5dc88e3214e35348335120caf20732c0b5b2 (patch) | |
tree | 8a99954ac28e70b328ee4e3a11a1ab658714ca27 /src/gui/styles | |
parent | a3cd7065c5b630d9d949cc53db36f5c2d091c9fc (diff) | |
parent | bc02c00130d6ebbd149caff8c21b6b1dc5c5451f (diff) | |
download | Qt-737b5dc88e3214e35348335120caf20732c0b5b2.zip Qt-737b5dc88e3214e35348335120caf20732c0b5b2.tar.gz Qt-737b5dc88e3214e35348335120caf20732c0b5b2.tar.bz2 |
Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration:
Re-apply licenseheader text in source files for qt4.7
Fix QWidget::palettePropagation2() autotest on Symbian (part 2)
Fix QWidget::palettePropagation2() autotest on Symbian
QTBUG-19500 lupdate fails to run from the Mac binary package on Mac OS X 10.5
Fix text color in some cases of QML and QStaticText
Added qmlshadersplugin to Symbian s60installs.pro-file.
Fix KERN-EXEC 0 errors in symbian bearer plugin
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 2d2710c..14fdbd3 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -44,6 +44,7 @@ #include "qpainter.h" #include "qstyleoption.h" #include "qstyle.h" +#include "private/qapplication_p.h" #include "private/qt_s60_p.h" #include "private/qpixmap_raster_symbian_p.h" #include "private/qcore_symbian_p.h" @@ -1387,12 +1388,26 @@ QPixmap QS60StylePrivate::backgroundTexture(bool skipCreation) // Notify all widgets that palette is updated with the actual background texture. QPalette pal = QApplication::palette(); pal.setBrush(QPalette::Window, *m_background); + + //Application palette hash is automatically cleared when QApplication::setPalette is called. + //To avoid losing palette hash data, back it up before calling the setPalette() API and + //restore it afterwards. + typedef QHash<QByteArray, QPalette> PaletteHash; + PaletteHash hash; + if (qt_app_palettes_hash() || !qt_app_palettes_hash()->isEmpty()) + hash = *qt_app_palettes_hash(); QApplication::setPalette(pal); - setThemePaletteHash(&pal); + if (hash.isEmpty()) { + //set default theme palette hash + setThemePaletteHash(&pal); + } else { + for (int i = 0; i < hash.count() - 1; i++) { + QByteArray widgetClassName = hash.keys().at(i); + QApplication::setPalette(hash.value(widgetClassName), widgetClassName); + } + } storeThemePalette(&pal); - foreach (QWidget *widget, QApplication::allWidgets()){ - QEvent e(QEvent::PaletteChange); - QApplication::sendEvent(widget, &e); + foreach (QWidget *widget, QApplication::allWidgets()) { setThemePalette(widget); widget->ensurePolished(); } |