summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qmlgraphicstextedit/data/inputmethodhints.qml6
-rw-r--r--tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp16
-rw-r--r--tests/auto/declarative/qmlgraphicstextinput/data/inputmethodhints.qml6
-rw-r--r--tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp16
4 files changed, 44 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlgraphicstextedit/data/inputmethodhints.qml b/tests/auto/declarative/qmlgraphicstextedit/data/inputmethodhints.qml
new file mode 100644
index 0000000..c3d4c16
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicstextedit/data/inputmethodhints.qml
@@ -0,0 +1,6 @@
+import Qt 4.6
+
+TextEdit {
+ text: "Hello world!"
+ inputMethodHints: Qt.ImhNoPredictiveText
+}
diff --git a/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp
index 99e8259..2bfb280 100644
--- a/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp
+++ b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp
@@ -76,6 +76,7 @@ private slots:
void persistentSelection();
void focusOnPress();
void selection();
+ void inputMethodHints();
void cursorDelegate();
void delegateLoading();
@@ -600,6 +601,21 @@ void tst_qmlgraphicstextedit::selection()
QVERIFY(textEditObject->selectedText().size() == 10);
}
+void tst_qmlgraphicstextedit::inputMethodHints()
+{
+ QmlView *canvas = createView(SRCDIR "/data/inputMethodHints.qml");
+ canvas->execute();
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->root() != 0);
+ QmlGraphicsTextEdit *textEditObject = qobject_cast<QmlGraphicsTextEdit *>(canvas->root());
+ QVERIFY(textEditObject != 0);
+ QVERIFY(textEditObject->inputMethodHints() & Qt::ImhNoPredictiveText);
+ textEditObject->setInputMethodHints(Qt::ImhUppercaseOnly);
+ QVERIFY(textEditObject->inputMethodHints() & Qt::ImhUppercaseOnly);
+}
+
void tst_qmlgraphicstextedit::cursorDelegate()
{
QmlView* view = createView(SRCDIR "/data/cursorTest.qml");
diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/inputmethodhints.qml b/tests/auto/declarative/qmlgraphicstextinput/data/inputmethodhints.qml
new file mode 100644
index 0000000..b404682
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicstextinput/data/inputmethodhints.qml
@@ -0,0 +1,6 @@
+import Qt 4.6
+
+TextInput {
+ text: "Hello world!"
+ inputMethodHints: Qt.ImhNoPredictiveText
+}
diff --git a/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp
index 7896464..c8fe446 100644
--- a/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp
+++ b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp
@@ -65,6 +65,7 @@ private slots:
void maxLength();
void masks();
void validators();
+ void inputMethodHints();
void cursorDelegate();
void navigation();
@@ -489,6 +490,21 @@ void tst_qmlgraphicstextinput::validators()
QCOMPARE(strInput->hasAcceptableInput(), true);
}
+void tst_qmlgraphicstextinput::inputMethodHints()
+{
+ QmlView *canvas = createView(SRCDIR "/data/inputMethodHints.qml");
+ canvas->execute();
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->root() != 0);
+ QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput *>(canvas->root());
+ QVERIFY(textinputObject != 0);
+ QVERIFY(textinputObject->inputMethodHints() & Qt::ImhNoPredictiveText);
+ textinputObject->setInputMethodHints(Qt::ImhUppercaseOnly);
+ QVERIFY(textinputObject->inputMethodHints() & Qt::ImhUppercaseOnly);
+}
+
/*
TextInput element should only handle left/right keys until the cursor reaches
the extent of the text, then they should ignore the keys.