summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-09-20 10:41:53 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-09-20 11:31:37 (GMT)
commit6a9fced05be98e7acedc47711e8fce1dc795e764 (patch)
treeadb8702a8f331345a3ec526ec79a7089e0fa4df4
parent227bc692ec6e881b737f911071c912de4d01f55c (diff)
downloadQt-6a9fced05be98e7acedc47711e8fce1dc795e764.zip
Qt-6a9fced05be98e7acedc47711e8fce1dc795e764.tar.gz
Qt-6a9fced05be98e7acedc47711e8fce1dc795e764.tar.bz2
Make QStaticText honor QPainter::pen() for rich text on X11 w/raster
The document layou will call setPen() with the PaintContext's text color. If this is different from the current painter settings, the pen will be passed on to the paint engine. The result was that, on X11 using the raster (or opengl) engine, QStaticText would record the pen as changed even when it hadn't explicitly been changed by the document. Task-number: QTBUG-13740 Reviewed-by: Samuel
-rw-r--r--src/gui/text/qstatictext.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index b950b13..2eeafd2 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -43,6 +43,7 @@
#include "qstatictext_p.h"
#include <private/qtextengine_p.h>
#include <private/qfontengine_p.h>
+#include <qabstracttextdocumentlayout.h>
#include <QtGui/qapplication.h>
@@ -655,7 +656,9 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
p->save();
p->translate(topLeftPosition);
- document.drawContents(p);
+ QAbstractTextDocumentLayout::PaintContext ctx;
+ ctx.palette.setColor(QPalette::Text, p->pen().color());
+ document.documentLayout()->draw(p, ctx);
p->restore();
if (textWidth >= 0.0)