diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-08-17 12:52:09 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-05 04:07:49 +0200 |
commit | 06e2ce51d1170557e43d41767947a1d6eb74c637 (patch) | |
tree | e6e489e96095672772f8bf62b446c2d010cadd45 /tests/auto | |
parent | 8febd569408db19c8a83e16cc7a8574f9b00084b (diff) |
Fix delayed password masking mid-string.
Unmask the last character typed, not the last character in the string.
Change-Id: I9c70d2347bf878c18ab0a7f4ea76f755ca19a85c
Task-number: QTBUG-17003
Reviewed-by: Alan Alpert
(cherry picked from commit b98e9e69dd8ba33d5f01b9518d95b63b86c4b443)
Reviewed-on: http://codereview.qt.nokia.com/4165
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qlineedit/tst_qlineedit.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 68e88a87ed..fde77bca51 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -1728,6 +1728,13 @@ void tst_QLineEdit::passwordEchoDelay() QApplication::sendEvent(testWidget, &ev); QCOMPARE(testWidget->displayText(), QString(7, fillChar) + QLatin1Char('7')); + testWidget->setCursorPosition(3); + QCOMPARE(testWidget->displayText(), QString(7, fillChar) + QLatin1Char('7')); + QTest::keyPress(testWidget, 'a'); + QCOMPARE(testWidget->displayText(), QString(3, fillChar) + QLatin1Char('a') + QString(5, fillChar)); + QTest::keyPress(testWidget, Qt::Key_Backspace); + QCOMPARE(testWidget->displayText(), QString(8, fillChar)); + // restore clean state testWidget->setEchoMode(QLineEdit::Normal); } |