Fix TextInput and TextEdit inputMethodComposing autotests
authorJoona Petrell <joona.t.petrell@nokia.com>
Wed, 28 Sep 2011 14:47:19 +0000 (17:47 +0300)
committerQt by Nokia <qt-info@nokia.com>
Thu, 29 Sep 2011 06:31:26 +0000 (08:31 +0200)
In old QInputContext architecture events were send to focus
widget, which delivered the events to the text editor items.
In Qt5, input methods send events directly to the editor
object using QInputPanel::inputItem().

Task-number: QTBUG-21691

Change-Id: Ia219f0cc7caaeafc32f5d7674a6ab377e773d4fa
Reviewed-on: http://codereview.qt-project.org/5741
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp

index 3e92c35..ffb8188 100644 (file)
@@ -2404,21 +2404,21 @@ void tst_qsgtextedit::inputMethodComposing()
 
     {
         QInputMethodEvent event(text.mid(3), QList<QInputMethodEvent::Attribute>());
-        QGuiApplication::sendEvent(&view, &event);
+        QGuiApplication::sendEvent(edit, &event);
     }
-    QEXPECT_FAIL("", "QTBUG-21690", Abort);
+
     QCOMPARE(edit->isInputMethodComposing(), true);
     QCOMPARE(spy.count(), 1);
 
     {
         QInputMethodEvent event(text.mid(12), QList<QInputMethodEvent::Attribute>());
-        QGuiApplication::sendEvent(&view, &event);
+        QGuiApplication::sendEvent(edit, &event);
     }
     QCOMPARE(spy.count(), 1);
 
     {
         QInputMethodEvent event;
-        QGuiApplication::sendEvent(&view, &event);
+        QGuiApplication::sendEvent(edit, &event);
     }
     QCOMPARE(edit->isInputMethodComposing(), false);
     QCOMPARE(spy.count(), 2);
index 5f9771a..35e0e91 100644 (file)
@@ -2562,21 +2562,20 @@ void tst_qsgtextinput::inputMethodComposing()
     QCOMPARE(input->isInputMethodComposing(), false);
     {
         QInputMethodEvent event(text.mid(3), QList<QInputMethodEvent::Attribute>());
-        QGuiApplication::sendEvent(&view, &event);
+        QGuiApplication::sendEvent(input, &event);
     }
-    QEXPECT_FAIL("", QTBUG_21691_MESSAGE, Abort);
     QCOMPARE(input->isInputMethodComposing(), true);
     QCOMPARE(spy.count(), 1);
 
     {
         QInputMethodEvent event(text.mid(12), QList<QInputMethodEvent::Attribute>());
-        QGuiApplication::sendEvent(&view, &event);
+        QGuiApplication::sendEvent(input, &event);
     }
     QCOMPARE(spy.count(), 1);
 
     {
         QInputMethodEvent event;
-        QGuiApplication::sendEvent(&view, &event);
+        QGuiApplication::sendEvent(input, &event);
     }
     QCOMPARE(input->isInputMethodComposing(), false);
     QCOMPARE(spy.count(), 2);