summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp')
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 1fabc45cac..0e7186dd17 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -273,6 +273,7 @@ private slots:
void bidiLogicalMovement();
void selectAndCursorPosition();
+ void inputMethod();
void inputMethodSelection();
void inputMethodTentativeCommit();
@@ -3805,6 +3806,18 @@ void tst_QLineEdit::selectAndCursorPosition()
QCOMPARE(testWidget->cursorPosition(), 0);
}
+void tst_QLineEdit::inputMethod()
+{
+ // widget accepts input
+ QInputMethodQueryEvent queryEvent(Qt::ImEnabled);
+ QApplication::sendEvent(testWidget, &queryEvent);
+ QCOMPARE(queryEvent.value(Qt::ImEnabled).toBool(), true);
+
+ testWidget->setEnabled(false);
+ QApplication::sendEvent(testWidget, &queryEvent);
+ QCOMPARE(queryEvent.value(Qt::ImEnabled).toBool(), false);
+}
+
void tst_QLineEdit::inputMethodSelection()
{
testWidget->setText("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");