From: Andrew den Exter Date: Wed, 9 Nov 2011 01:33:12 +0000 (+1000) Subject: Fix TextInput inputMethods test. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3226ae7f0f4edc7e2bcebd0c56a3d63f8f76ac08;p=konrad%2Fqtdeclarative.git Fix TextInput inputMethods test. Input method events should go to the input panels input item not the canvas. Change-Id: I2792b8d51585c028c3ba1a109b3dea16bea18f61 Reviewed-by: Martin Jones --- diff --git a/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp index 7e38148..3067952 100644 --- a/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp @@ -1497,25 +1497,24 @@ void tst_qquicktextinput::inputMethods() // test that input method event is committed QInputMethodEvent event; event.setCommitString( "My ", -12, 0); - QGuiApplication::sendEvent(&canvas, &event); - QEXPECT_FAIL("", QTBUG_21691_MESSAGE, Abort); + QGuiApplication::sendEvent(qGuiApp->inputPanel()->inputItem(), &event); QCOMPARE(input->text(), QString("My Hello world!")); input->setCursorPosition(2); event.setCommitString("Your", -2, 2); - QGuiApplication::sendEvent(&canvas, &event); + QGuiApplication::sendEvent(qGuiApp->inputPanel()->inputItem(), &event); QCOMPARE(input->text(), QString("Your Hello world!")); QCOMPARE(input->cursorPosition(), 4); input->setCursorPosition(7); event.setCommitString("Goodbye", -2, 5); - QGuiApplication::sendEvent(&canvas, &event); + QGuiApplication::sendEvent(qGuiApp->inputPanel()->inputItem(), &event); QCOMPARE(input->text(), QString("Your Goodbye world!")); QCOMPARE(input->cursorPosition(), 12); input->setCursorPosition(8); event.setCommitString("Our", -8, 4); - QGuiApplication::sendEvent(&canvas, &event); + QGuiApplication::sendEvent(qGuiApp->inputPanel()->inputItem(), &event); QCOMPARE(input->text(), QString("Our Goodbye world!")); QCOMPARE(input->cursorPosition(), 7); }