summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-08-16 09:02:46 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-08-17 10:11:19 (GMT)
commite0c798ebb4fc56fa6be38f6ec3e82de147891260 (patch)
tree2a127e04cc8d7dc0fde8a9dc82e22fb636f7b9a8 /src
parent87e9034caf90fb02ae2564947b9cbf464b3ca97c (diff)
downloadQt-e0c798ebb4fc56fa6be38f6ec3e82de147891260.zip
Qt-e0c798ebb4fc56fa6be38f6ec3e82de147891260.tar.gz
Qt-e0c798ebb4fc56fa6be38f6ec3e82de147891260.tar.bz2
Repaint TextInput when password character changes in password mode
Task-number: QTBUG-12838 Reviewed-by: Martin Jones
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index bd8d404..b4f36f4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -277,8 +277,10 @@ void QDeclarativeTextInput::setSelectionColor(const QColor &color)
QPalette p = d->control->palette();
p.setColor(QPalette::Highlight, d->selectionColor);
d->control->setPalette(p);
- clearCache();
- update();
+ if (d->control->hasSelectedText()) {
+ clearCache();
+ update();
+ }
emit selectionColorChanged(color);
}
@@ -303,8 +305,10 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
QPalette p = d->control->palette();
p.setColor(QPalette::HighlightedText, d->selectedTextColor);
d->control->setPalette(p);
- clearCache();
- update();
+ if (d->control->hasSelectedText()) {
+ clearCache();
+ update();
+ }
emit selectedTextColorChanged(color);
}
@@ -1233,8 +1237,12 @@ void QDeclarativeTextInput::setPasswordCharacter(const QString &str)
Q_D(QDeclarativeTextInput);
if(str.length() < 1)
return;
- emit passwordCharacterChanged();
d->control->setPasswordCharacter(str.constData()[0]);
+ EchoMode echoMode_ = echoMode();
+ if (echoMode_ == Password || echoMode_ == PasswordEchoOnEdit) {
+ updateSize();
+ }
+ emit passwordCharacterChanged();
}
/*!