diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-09-20 10:41:53 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-09-20 10:49:45 (GMT) |
commit | 4d8adcd20af9f346d69c9da9e49c9b3cc8a10710 (patch) | |
tree | 62cb3ea7286e86078deccc91abb7ef704e2e67c1 /src/gui/text/qstatictext.cpp | |
parent | 1dd510f486937974bf342dcbd6ce7cb7bb331375 (diff) | |
download | Qt-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
Diffstat (limited to 'src/gui/text/qstatictext.cpp')
-rw-r--r-- | src/gui/text/qstatictext.cpp | 5 |
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) |