summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-07-02 00:30:27 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-07-02 00:30:27 (GMT)
commit737b5dc88e3214e35348335120caf20732c0b5b2 (patch)
tree8a99954ac28e70b328ee4e3a11a1ab658714ca27 /src/gui
parenta3cd7065c5b630d9d949cc53db36f5c2d091c9fc (diff)
parentbc02c00130d6ebbd149caff8c21b6b1dc5c5451f (diff)
downloadQt-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')
-rw-r--r--src/gui/styles/qs60style_s60.cpp23
-rw-r--r--src/gui/text/qstatictext.cpp10
2 files changed, 26 insertions, 7 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();
}
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index d8192b7..c985427 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -427,14 +427,17 @@ namespace {
public:
DrawTextItemRecorder(bool untransformedCoordinates, bool useBackendOptimizations)
: m_dirtyPen(false), m_useBackendOptimizations(useBackendOptimizations),
- m_untransformedCoordinates(untransformedCoordinates)
+ m_untransformedCoordinates(untransformedCoordinates), m_currentColor(Qt::black)
{
}
virtual void updateState(const QPaintEngineState &newState)
{
- if (newState.state() & QPaintEngine::DirtyPen)
+ if (newState.state() & QPaintEngine::DirtyPen
+ && newState.pen().color() != m_currentColor) {
m_dirtyPen = true;
+ m_currentColor = newState.pen().color();
+ }
}
virtual void drawTextItem(const QPointF &position, const QTextItem &textItem)
@@ -450,7 +453,7 @@ namespace {
currentItem.positionOffset = m_glyphs.size(); // Offset into position pool
currentItem.useBackendOptimizations = m_useBackendOptimizations;
if (m_dirtyPen)
- currentItem.color = state->pen().color();
+ currentItem.color = m_currentColor;
QTransform matrix = m_untransformedCoordinates ? QTransform() : state->transform();
matrix.translate(position.x(), position.y());
@@ -521,6 +524,7 @@ namespace {
bool m_dirtyPen;
bool m_useBackendOptimizations;
bool m_untransformedCoordinates;
+ QColor m_currentColor;
};
class DrawTextItemDevice: public QPaintDevice