diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2012-02-02 14:58:49 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 16:31:27 +0100 |
commit | 4ab22fd809a43a57bf401e68282b697d5e5fd008 (patch) | |
tree | 030733f3c19f86b9e09adac4dda1d9be5893425f /tests/auto/qtquick1/qdeclarativetextinput | |
parent | ee9c5f72d3f48e2d2d3829f39d7accc3513110ab (diff) |
Adapt to QGuiApplication::focusObject() for notifying input method
Emitting focusObjectChanged() signal now instead of explicitly setting
inputItem to QInputPanel. Also adapted from deprecated
QInputPanel::inputItem() to QGuiApplication::focusObject().
Change-Id: I97460625cc8bb2820ec7716a06330aecd1b585ea
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'tests/auto/qtquick1/qdeclarativetextinput')
-rw-r--r-- | tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 221d38a95c..ece6818071 100644 --- a/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -79,7 +79,7 @@ void sendPreeditText(const QString &text, int cursor) attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursor, text.length(), QVariant())); QInputMethodEvent event(text, attributes); - QApplication::sendEvent(qApp->inputPanel()->inputItem(), &event); + QApplication::sendEvent(qApp->focusObject(), &event); } @@ -2634,7 +2634,7 @@ void tst_qdeclarativetextinput::preeditMicroFocus() sendPreeditText(preeditText, 0); ic.clear(); QInputMethodEvent imEvent(preeditText, QList<QInputMethodEvent::Attribute>()); - QApplication::sendEvent(qApp->inputPanel()->inputItem(), &imEvent); + QApplication::sendEvent(qApp->focusObject(), &imEvent); currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); #if defined(Q_WS_X11) || defined(Q_WS_QWS) @@ -2705,7 +2705,7 @@ void tst_qdeclarativetextinput::inputMethodComposing() { QInputMethodEvent inputEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()); - QApplication::sendEvent(qApp->inputPanel()->inputItem(), &inputEvent); + QApplication::sendEvent(qApp->focusObject(), &inputEvent); } QCOMPARE(input.isInputMethodComposing(), true); @@ -2713,7 +2713,7 @@ void tst_qdeclarativetextinput::inputMethodComposing() { QInputMethodEvent inputEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()); - QApplication::sendEvent(qApp->inputPanel()->inputItem(), &inputEvent); + QApplication::sendEvent(qApp->focusObject(), &inputEvent); } QCOMPARE(input.isInputMethodComposing(), true); @@ -2721,7 +2721,7 @@ void tst_qdeclarativetextinput::inputMethodComposing() { QInputMethodEvent inputEvent; - QApplication::sendEvent(qApp->inputPanel()->inputItem(), &inputEvent); + QApplication::sendEvent(qApp->focusObject(), &inputEvent); } QCOMPARE(input.isInputMethodComposing(), false); QCOMPARE(spy.count(), 2); |