diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-03-23 13:36:29 +0100 |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2012-03-23 14:10:58 +0100 |
commit | 3b512ae142017f105f297467f74dc28d3cb9030a (patch) | |
tree | 9e131e23c01537f051851a1da9576c1e1ddf5ba2 /tests/auto/widgets/widgets | |
parent | e20c4730192f312881591fb50e571af0a88fe421 (diff) | |
parent | f956f9a83603a3df5651e3238c24e8df37558d6e (diff) |
Merge master into api_changes
Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r-- | tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 81dc940c00..f67f7ce1e8 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -3846,13 +3846,26 @@ void tst_QLineEdit::inputMethodSelection() QCOMPARE(selectionSpy.count(), 1); QCOMPARE(testWidget->selectionStart(), 0); - QList<QInputMethodEvent::Attribute> attributes; - attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 12, 5, QVariant()); - QInputMethodEvent event("", attributes); - QApplication::sendEvent(testWidget, &event); + // selection gained + { + QList<QInputMethodEvent::Attribute> attributes; + attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 12, 5, QVariant()); + QInputMethodEvent event("", attributes); + QApplication::sendEvent(testWidget, &event); + } QCOMPARE(selectionSpy.count(), 2); QCOMPARE(testWidget->selectionStart(), 12); + + // selection removed + { + QList<QInputMethodEvent::Attribute> attributes; + attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant()); + QInputMethodEvent event("", attributes); + QApplication::sendEvent(testWidget, &event); + } + + QCOMPARE(selectionSpy.count(), 3); } void tst_QLineEdit::inputMethodTentativeCommit() |