Use Qt::ImhSensitiveData input hint on TextInput with password echo mode
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>
Mon, 2 Jan 2012 14:40:12 +0000 (16:40 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 3 Jan 2012 13:57:36 +0000 (14:57 +0100)
Change-Id: I1e9255af24b51ca42c1e6df7a92664be532ce725
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
src/quick/items/qquicktextinput.cpp
tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp

index e514c38..c271b77 100644 (file)
@@ -952,7 +952,7 @@ void QQuickTextInputPrivate::updateInputMethodHints()
     else if (m_echoMode == QQuickTextInput::PasswordEchoOnEdit)
         hints &= ~Qt::ImhHiddenText;
     if (m_echoMode != QQuickTextInput::Normal)
-        hints |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+        hints |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText | Qt::ImhSensitiveData);
     q->setInputMethodHints(hints);
 }
 /*!
index f07e8fd..10220a6 100644 (file)
@@ -2178,7 +2178,7 @@ void tst_qquicktextinput::echoMode()
     QCOMPARE(input->displayText(), input->text());
     //Normal
     ref &= ~Qt::ImhHiddenText;
-    ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+    ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText | Qt::ImhSensitiveData);
     QCOMPARE(input->inputMethodHints(), ref);
     input->setEchoMode(QQuickTextInput::NoEcho);
     QCOMPARE(input->text(), initial);
@@ -2186,12 +2186,12 @@ void tst_qquicktextinput::echoMode()
     QCOMPARE(input->passwordCharacter(), QLatin1String("*"));
     //NoEcho
     ref |= Qt::ImhHiddenText;
-    ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+    ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText | Qt::ImhSensitiveData);
     QCOMPARE(input->inputMethodHints(), ref);
     input->setEchoMode(QQuickTextInput::Password);
     //Password
     ref |= Qt::ImhHiddenText;
-    ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+    ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText | Qt::ImhSensitiveData);
     QCOMPARE(input->text(), initial);
     QCOMPARE(input->displayText(), QLatin1String("********"));
     QCOMPARE(input->inputMethodHints(), ref);
@@ -2202,7 +2202,7 @@ void tst_qquicktextinput::echoMode()
     input->setEchoMode(QQuickTextInput::PasswordEchoOnEdit);
     //PasswordEchoOnEdit
     ref &= ~Qt::ImhHiddenText;
-    ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+    ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText | Qt::ImhSensitiveData);
     QCOMPARE(input->inputMethodHints(), ref);
     QCOMPARE(input->text(), initial);
     QCOMPARE(input->displayText(), QLatin1String("QQQQQQQQ"));