diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2010-08-16 09:02:46 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2010-08-17 10:11:19 (GMT) |
commit | e0c798ebb4fc56fa6be38f6ec3e82de147891260 (patch) | |
tree | 2a127e04cc8d7dc0fde8a9dc82e22fb636f7b9a8 /tests/auto | |
parent | 87e9034caf90fb02ae2564947b9cbf464b3ca97c (diff) | |
download | Qt-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 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index ca9009d..98a6012 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -98,6 +98,7 @@ private slots: void validators(); void inputMethods(); + void passwordCharacter(); void cursorDelegate(); void navigation(); void copyAndPaste(); @@ -768,6 +769,21 @@ void tst_qdeclarativetextinput::copyAndPaste() { #endif } +void tst_qdeclarativetextinput::passwordCharacter() +{ + QString componentStr = "import Qt 4.7\nTextInput { text: \"Hello world!\"; font.family: \"Helvetica\"; echoMode: TextInput.Password }"; + QDeclarativeComponent textInputComponent(&engine); + textInputComponent.setData(componentStr.toLatin1(), QUrl()); + QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create()); + QVERIFY(textInput != 0); + + textInput->setPasswordCharacter("X"); + QSize contentsSize = textInput->contentsSize(); + textInput->setPasswordCharacter("."); + // QTBUG-12383 content is updated and redrawn + QVERIFY(contentsSize != textInput->contentsSize()); +} + void tst_qdeclarativetextinput::cursorDelegate() { QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml"); |