summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-03-10 06:38:20 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2011-03-11 04:44:48 (GMT)
commit27f0c5054e5326bf16f40436ba4e72927ea89cc1 (patch)
treed0658e2ed1632db0561c3413b74240214a34537e /src/gui/widgets
parent68415b0bcc3e531dc16516aa6788aeef8bced6f2 (diff)
downloadQt-27f0c5054e5326bf16f40436ba4e72927ea89cc1.zip
Qt-27f0c5054e5326bf16f40436ba4e72927ea89cc1.tar.gz
Qt-27f0c5054e5326bf16f40436ba4e72927ea89cc1.tar.bz2
Don't reveal TextInput text on refocus in PasswordEchoOnEdit mode.
In PasswordEchoOnEdit mode return the display text instead of the real text from inputMethodQuery() when not editing the password and clear old password if new input is received through an input method event. Change-Id: I7f24f510bf8e356e460900c3b9ff55ea16b32ab3 Task-number: QTBUG-17562 Reviewed-by: Joona Petrell
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index bffc2b5..5a281ad 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -414,10 +414,14 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
if (isGettingInput) {
// If any text is being input, remove selected text.
priorState = m_undoState;
+ if (echoMode() == QLineEdit::PasswordEchoOnEdit && !passwordEchoEditing()) {
+ updatePasswordEchoEditing(true);
+ m_selstart = 0;
+ m_selend = m_text.length();
+ }
removeSelectedText();
}
-
int c = m_cursor; // cursor position after insertion of commit string
if (event->replacementStart() <= 0)
c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength());