summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@nokia.com>2012-05-22 03:05:00 +0900
committerQt by Nokia <qt-info@nokia.com>2012-05-23 01:11:27 +0200
commit8b78b3a620fac8e7c2219b0a2c3feda9857848fd (patch)
treec75e27e519f810a234b1d5d3e38d9d5b4bae1461 /tests
parent6ee1c645aca0a72d634af9cef986c45d66255351 (diff)
Fixed QLineEdit::inputMethodQuery() for Qt::ImHints
It should return QWidget::inputMethodHints() instead of QVariant() Change-Id: I01f5de8f2087ac67d125f54f08abed523653eb92 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 91827eca6d..7fe71b0a53 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -283,6 +283,9 @@ private slots:
void inputMethod();
void inputMethodSelection();
+ void inputMethodQueryImHints_data();
+ void inputMethodQueryImHints();
+
protected slots:
void editingFinished();
@@ -3924,6 +3927,24 @@ void tst_QLineEdit::inputMethodSelection()
QCOMPARE(selectionSpy.count(), 3);
}
+Q_DECLARE_METATYPE(Qt::InputMethodHints)
+void tst_QLineEdit::inputMethodQueryImHints_data()
+{
+ QTest::addColumn<Qt::InputMethodHints>("hints");
+
+ QTest::newRow("None") << static_cast<Qt::InputMethodHints>(Qt::ImhNone);
+ QTest::newRow("Password") << static_cast<Qt::InputMethodHints>(Qt::ImhHiddenText);
+ QTest::newRow("Normal") << static_cast<Qt::InputMethodHints>(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText | Qt::ImhSensitiveData);
+}
+
+void tst_QLineEdit::inputMethodQueryImHints()
+{
+ QFETCH(Qt::InputMethodHints, hints);
+ testWidget->setInputMethodHints(hints);
+
+ QVariant value = testWidget->inputMethodQuery(Qt::ImHints);
+ QCOMPARE(static_cast<Qt::InputMethodHints>(value.toInt()), hints);
+}
QTEST_MAIN(tst_QLineEdit)
#include "tst_qlineedit.moc"