summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-10-01 11:25:28 (GMT)
committeraxis <qt-info@nokia.com>2010-10-08 13:03:54 (GMT)
commit4ee912a752a4b7f129e98e180328f1f46f053d4f (patch)
tree18b991616665a01132dfb068647b1d96a8ab4c1c /tests
parentaa0f3a7745472ea8c9ca43bb7d690a0591bde83b (diff)
downloadQt-4ee912a752a4b7f129e98e180328f1f46f053d4f.zip
Qt-4ee912a752a4b7f129e98e180328f1f46f053d4f.tar.gz
Qt-4ee912a752a4b7f129e98e180328f1f46f053d4f.tar.bz2
Added support for using inputMethodHints in QInputDialog edit widget.
AutoTest: Included Task: QTBUG-13200 RevBy: Denis Dzyubenko
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qinputdialog/tst_qinputdialog.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qinputdialog/tst_qinputdialog.cpp b/tests/auto/qinputdialog/tst_qinputdialog.cpp
index 0d6644a..5d03142 100644
--- a/tests/auto/qinputdialog/tst_qinputdialog.cpp
+++ b/tests/auto/qinputdialog/tst_qinputdialog.cpp
@@ -74,6 +74,7 @@ private slots:
void getItem_data();
void getItem();
void task256299_getTextReturnNullStringOnRejected();
+ void inputMethodHintsOfChildWidget();
};
QString stripFraction(const QString &s)
@@ -404,5 +405,24 @@ void tst_QInputDialog::getItem()
delete parent;
}
+void tst_QInputDialog::inputMethodHintsOfChildWidget()
+{
+ QInputDialog dialog;
+ dialog.setInputMode(QInputDialog::TextInput);
+ QList<QObject *> children = dialog.children();
+ QLineEdit *editWidget = 0;
+ for (int c = 0; c < children.size(); c++) {
+ editWidget = qobject_cast<QLineEdit *>(children.at(c));
+ if (editWidget)
+ break;
+ }
+ QVERIFY(editWidget);
+ QCOMPARE(editWidget->inputMethodHints(), dialog.inputMethodHints());
+ QCOMPARE(editWidget->inputMethodHints(), Qt::ImhNone);
+ dialog.setInputMethodHints(Qt::ImhDigitsOnly);
+ QCOMPARE(editWidget->inputMethodHints(), dialog.inputMethodHints());
+ QCOMPARE(editWidget->inputMethodHints(), Qt::ImhDigitsOnly);
+}
+
QTEST_MAIN(tst_QInputDialog)
#include "tst_qinputdialog.moc"