summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativetextedit.cpp
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-07-06 01:11:59 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-07-06 01:16:14 (GMT)
commit5500ffeeaee3412272f0f4af844fbc1d4d78a3bb (patch)
tree6b9c124f72272a4cc6f84c1ce1627126720d2e67 /src/declarative/graphicsitems/qdeclarativetextedit.cpp
parent8274fdc7ee8ecc03bb879ea79e9b3b3b4ca9ab37 (diff)
downloadQt-5500ffeeaee3412272f0f4af844fbc1d4d78a3bb.zip
Qt-5500ffeeaee3412272f0f4af844fbc1d4d78a3bb.tar.gz
Qt-5500ffeeaee3412272f0f4af844fbc1d4d78a3bb.tar.bz2
Fix TextEdit with no color property defined is drawn with wrong color
Task-number: QTBUG-11932 Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextedit.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index c066f11..5b4d80b 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1263,6 +1263,15 @@ void QDeclarativeTextEditPrivate::init()
control = new QTextControl(q);
control->setIgnoreUnusedNavigationEvents(true);
+ // QTextControl follows the default text color
+ // defined by the platform, declarative text
+ // should be black by default
+ QPalette pal = control->palette();
+ if (pal.color(QPalette::Text) != color) {
+ pal.setColor(QPalette::Text, color);
+ control->setPalette(pal);
+ }
+
QObject::connect(control, SIGNAL(updateRequest(QRectF)), q, SLOT(updateImgCache(QRectF)));
QObject::connect(control, SIGNAL(textChanged()), q, SLOT(q_textChanged()));