summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-26 10:56:55 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-29 12:09:17 (GMT)
commitd717d2686ecdbeafee1f5cabc6832c8339cfb2b4 (patch)
treea64103fc91a3dda5fdf6cb7414a5146665507ce9 /src/gui/painting
parente7eb7bdf63791ed03257f2f23b1f515e4d89e054 (diff)
downloadQt-d717d2686ecdbeafee1f5cabc6832c8339cfb2b4.zip
Qt-d717d2686ecdbeafee1f5cabc6832c8339cfb2b4.tar.gz
Qt-d717d2686ecdbeafee1f5cabc6832c8339cfb2b4.tar.bz2
Respect QPainter::pen() in QPainter::drawStaticText()
QStaticText needs to support changing the pen on the painter to support rich text, but it should not override the pen unless it has been explicitly set in the rich text. We do this by marking the pen as dirty in updateState() when we record the text items. Task-number: QTBUG-8908 Reviewed-by: Gunnar
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpainter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 1c528fe..ac5c8b7 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5901,7 +5901,7 @@ void QPainter::drawStaticText(const QPointF &position, const QStaticText &static
QColor currentColor = oldPen.color();
for (int i=0; i<staticText_d->itemCount; ++i) {
QStaticTextItem *item = staticText_d->items + i;
- if (currentColor != item->color) {
+ if (item->color.isValid() && currentColor != item->color) {
setPen(item->color);
currentColor = item->color;
}