summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-26 09:26:27 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-26 09:31:23 (GMT)
commitc8494e085cd5abc3b30229409c7dacac676c81b9 (patch)
tree078c20210cbc1a6e530e4447bf067be03c740ea5 /src
parent0f06d08a3c5eb4d0397406ed559cfaba6e137492 (diff)
downloadQt-c8494e085cd5abc3b30229409c7dacac676c81b9.zip
Qt-c8494e085cd5abc3b30229409c7dacac676c81b9.tar.gz
Qt-c8494e085cd5abc3b30229409c7dacac676c81b9.tar.bz2
QGraphicsTextItem::setDefaultTextColor check change before calling update()
Some applications call setDefaultTextColor in the paint event. Task-number: QTBUG-6242 Reviewed-by: Gabriel
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 34f42fb..1f87cd9 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -9441,9 +9441,11 @@ void QGraphicsTextItem::setDefaultTextColor(const QColor &col)
{
QTextControl *c = dd->textControl();
QPalette pal = c->palette();
+ QColor old = pal.color(QPalette::Text);
pal.setColor(QPalette::Text, col);
c->setPalette(pal);
- update();
+ if (old != col)
+ update();
}
/*!