summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-04-18 12:54:24 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-04-18 13:15:06 (GMT)
commit518c2a58ed6fdfd7449cb4476aa8ea0d32ad16e3 (patch)
treec3c026d87b690391cff97aa6b4c4d6b868674ba2
parent54bc4f3562bd81fa7e52e7d2d47b697d01c5b4b3 (diff)
downloadQt-518c2a58ed6fdfd7449cb4476aa8ea0d32ad16e3.zip
Qt-518c2a58ed6fdfd7449cb4476aa8ea0d32ad16e3.tar.gz
Qt-518c2a58ed6fdfd7449cb4476aa8ea0d32ad16e3.tar.bz2
Fix missing color in text when using static text back-end in QML
Using QStaticTextItem as a back-end for QML text on GL caused a regression where parts of a text element would get the wrong color. This was because the color set on the painter which was passed into draw() was never transferred to the painter used to record the draw text calls issued by the underlying QTextLayout::draw()-function. Task-number: QTBUG-18428 Reviewed-by: Jiang Jiang
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout_p.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
index 31819f5..c5f40b3 100644
--- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
@@ -299,7 +299,7 @@ void QDeclarativeTextLayout::clearLayout()
QTextLayout::clearLayout();
}
-void QDeclarativeTextLayout::prepare()
+void QDeclarativeTextLayout::prepare(QPainter *painter)
{
if (!d || !d->cached) {
@@ -308,6 +308,7 @@ void QDeclarativeTextLayout::prepare()
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();
@@ -340,7 +341,7 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
return;
}
- prepare();
+ prepare(painter);
int itemCount = d->items.count();
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout_p.h b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h
index 2c9264e..23b22a6 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();
+ void prepare(QPainter *);
void draw(QPainter *, const QPointF & = QPointF());
private: