diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-29 15:33:44 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-29 15:33:44 (GMT) |
commit | 564d2a31a1fd7dfff9a4f6cc2ae814d9307e88a9 (patch) | |
tree | 6e35b7c0091c5cc7514b8740cfaf90234a48bbca /src/gui | |
parent | 6469ed030a0edbb08b7856c9292fcceb155dff86 (diff) | |
parent | f8560717dd56514269cfb081c7f4b94e231e10d7 (diff) | |
download | Qt-564d2a31a1fd7dfff9a4f6cc2ae814d9307e88a9.zip Qt-564d2a31a1fd7dfff9a4f6cc2ae814d9307e88a9.tar.gz Qt-564d2a31a1fd7dfff9a4f6cc2ae814d9307e88a9.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fix text color in some cases of QML and QStaticText
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qstatictext.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index 414de51..73a871b 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -430,14 +430,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) @@ -453,7 +456,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()); @@ -524,6 +527,7 @@ namespace { bool m_dirtyPen; bool m_useBackendOptimizations; bool m_untransformedCoordinates; + QColor m_currentColor; }; class DrawTextItemDevice: public QPaintDevice |