From f9a574aee1afefaa890d5b715605e416e24dc692 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Mon, 2 Jan 2012 16:40:12 +0200 Subject: [PATCH] Use Qt::ImhSensitiveData input hint on TextInput with password echo mode Change-Id: I1e9255af24b51ca42c1e6df7a92664be532ce725 Reviewed-by: Joona Petrell --- src/quick/items/qquicktextinput.cpp | 2 +- tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index e514c38..c271b77 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -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); } /*! diff --git a/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp index f07e8fd..10220a6 100644 --- a/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp @@ -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")); -- 2.7.4