diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-11-09 11:33:12 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-09 09:55:01 +0100 |
commit | 3226ae7f0f4edc7e2bcebd0c56a3d63f8f76ac08 (patch) | |
tree | f9570dc67e5ff9efa372571ec8677a138ff379a5 /tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp | |
parent | 28102d1935dfd7fc88c4bb3b656aadc44942f562 (diff) |
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 <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp')
-rw-r--r-- | tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp index 7e381480cf..30679520d0 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); } |