aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-12-12 14:50:01 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-12 08:20:32 +0100
commit841e6ae8ac76210af7d8475befd8fd97f6b7ab97 (patch)
tree6f376e4f210f020c10b4c9a9fbb90d574166550a
parent80614c8a26140bbb98533d72a7d1696c197c5de6 (diff)
Fix TextInput not reacting to text color change.
Trigger a relayout with the new color when the color property is changed. Task-number: QTBUG-22402 Change-Id: I2dc190e097e878ac498fd04c2800a6e11947527c Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
-rw-r--r--src/quick/items/qquicktextinput.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index b389329243..8fc2fee551 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -259,6 +259,7 @@ void QQuickTextInput::setColor(const QColor &c)
Q_D(QQuickTextInput);
if (c != d->color) {
d->color = c;
+ d->textLayoutDirty = true;
update();
emit colorChanged(c);
}
@@ -286,8 +287,10 @@ void QQuickTextInput::setSelectionColor(const QColor &color)
QPalette p = d->control->palette();
p.setColor(QPalette::Highlight, d->selectionColor);
d->control->setPalette(p);
- if (d->control->hasSelectedText())
+ if (d->control->hasSelectedText()) {
+ d->textLayoutDirty = true;
update();
+ }
emit selectionColorChanged(color);
}
/*!
@@ -311,8 +314,10 @@ void QQuickTextInput::setSelectedTextColor(const QColor &color)
QPalette p = d->control->palette();
p.setColor(QPalette::HighlightedText, d->selectedTextColor);
d->control->setPalette(p);
- if (d->control->hasSelectedText())
+ if (d->control->hasSelectedText()) {
+ d->textLayoutDirty = true;
update();
+ }
emit selectedTextColorChanged(color);
}