summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-09-20 10:41:53 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-09-20 10:49:45 (GMT)
commit4d8adcd20af9f346d69c9da9e49c9b3cc8a10710 (patch)
tree62cb3ea7286e86078deccc91abb7ef704e2e67c1
parent1dd510f486937974bf342dcbd6ce7cb7bb331375 (diff)
downloadQt-4d8adcd20af9f346d69c9da9e49c9b3cc8a10710.zip
Qt-4d8adcd20af9f346d69c9da9e49c9b3cc8a10710.tar.gz
Qt-4d8adcd20af9f346d69c9da9e49c9b3cc8a10710.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 7a5dec4..9506006 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>
@@ -654,7 +655,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)