summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-03-23 13:36:29 +0100
committerKent Hansen <kent.hansen@nokia.com>2012-03-23 14:10:58 +0100
commit3b512ae142017f105f297467f74dc28d3cb9030a (patch)
tree9e131e23c01537f051851a1da9576c1e1ddf5ba2 /tests/auto/widgets/widgets
parente20c4730192f312881591fb50e571af0a88fe421 (diff)
parentf956f9a83603a3df5651e3238c24e8df37558d6e (diff)
Merge master into api_changes
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp21
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()