diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-07-01 07:00:13 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-07-01 07:00:13 (GMT) |
commit | 3dc0c38389670d6adddd972c532af98dd6b5deb5 (patch) | |
tree | 779945938b51cc6290bc6dcee1cb34f696f42242 /src/declarative | |
parent | 73f0d9534b593c65e4facf9a975e2c2e63608f03 (diff) | |
parent | f5feea56fc7202ab64a1b9c5f9b05391c2b88238 (diff) | |
download | Qt-3dc0c38389670d6adddd972c532af98dd6b5deb5.zip Qt-3dc0c38389670d6adddd972c532af98dd6b5deb5.tar.gz Qt-3dc0c38389670d6adddd972c532af98dd6b5deb5.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
src/s60installs/s60installs.pro
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextlayout.cpp | 15 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextlayout_p.h | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp index 73a8570..e7bcf1f 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp @@ -69,14 +69,17 @@ class DrawTextItemRecorder: public QPaintEngine public: DrawTextItemRecorder(bool untransformedCoordinates, bool useBackendOptimizations) : m_inertText(0), 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) @@ -112,7 +115,7 @@ class DrawTextItemRecorder: public QPaintEngine currentItem.positionOffset = positionOffset; currentItem.useBackendOptimizations = m_useBackendOptimizations; if (m_dirtyPen) - currentItem.color = state->pen().color(); + currentItem.color = m_currentColor; m_inertText->items.append(currentItem); } @@ -169,6 +172,7 @@ class DrawTextItemRecorder: public QPaintEngine bool m_dirtyPen; bool m_useBackendOptimizations; bool m_untransformedCoordinates; + QColor m_currentColor; }; class DrawTextItemDevice: public QPaintDevice @@ -296,7 +300,7 @@ void QDeclarativeTextLayout::clearLayout() QTextLayout::clearLayout(); } -void QDeclarativeTextLayout::prepare(QPainter *painter) +void QDeclarativeTextLayout::prepare() { if (!d || !d->cached) { @@ -305,7 +309,6 @@ void QDeclarativeTextLayout::prepare(QPainter *painter) InertTextPainter *itp = inertTextPainter(); itp->device.begin(d); - itp->painter.setPen(painter->pen()); QTextLayout::draw(&itp->painter, QPointF(0, 0)); glyph_t *glyphPool = d->glyphs.data(); @@ -344,7 +347,7 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p) return; } - prepare(painter); + prepare(); int itemCount = d->items.count(); diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout_p.h b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h index 85d333e..d83ce7e 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h @@ -61,7 +61,7 @@ public: void beginLayout(); void clearLayout(); - void prepare(QPainter *); + void prepare(); void draw(QPainter *, const QPointF & = QPointF()); private: |