From bfdecd0e2047fc49ed28ed095e657080897c91d1 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Wed, 16 Feb 2011 17:08:10 +1000 Subject: Fix TextInput, TextEdit auto test failure on windows and mac. Micro focus is only updated on X11, QWS and Symbian platforms. Change-Id: Id02655cba79429e91022593ff0d1d6b8068c84ec Reviewed-by: Martin Jones --- .../declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 6 ++++++ .../declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 7226dc9..87c2c60 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -1839,7 +1839,9 @@ void tst_qdeclarativetextedit::preeditMicroFocus() ic.sendPreeditText(preeditText, 0); currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); +#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QCOMPARE(ic.updateReceived, true); +#endif // Verify that the micro focus rect moves to the left as the cursor position // is incremented. @@ -1848,7 +1850,9 @@ void tst_qdeclarativetextedit::preeditMicroFocus() ic.sendPreeditText(preeditText, i); currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); QVERIFY(previousRect.left() < currentRect.left()); +#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QCOMPARE(ic.updateReceived, true); +#endif previousRect = currentRect; } @@ -1859,7 +1863,9 @@ void tst_qdeclarativetextedit::preeditMicroFocus() ic.sendEvent(QInputMethodEvent(preeditText, QList())); currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); +#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QCOMPARE(ic.updateReceived, true); +#endif } QTEST_MAIN(tst_qdeclarativetextedit) diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 77cb323..7753f11 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -1830,7 +1830,9 @@ void tst_qdeclarativetextinput::preeditMicroFocus() ic.sendPreeditText(preeditText, 0); currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); +#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QCOMPARE(ic.updateReceived, true); +#endif // Verify that the micro focus rect moves to the left as the cursor position // is incremented. @@ -1839,7 +1841,9 @@ void tst_qdeclarativetextinput::preeditMicroFocus() ic.sendPreeditText(preeditText, i); currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect(); QVERIFY(previousRect.left() < currentRect.left()); +#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QCOMPARE(ic.updateReceived, true); +#endif previousRect = currentRect; } @@ -1850,7 +1854,9 @@ void tst_qdeclarativetextinput::preeditMicroFocus() ic.sendEvent(QInputMethodEvent(preeditText, QList())); currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); +#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QCOMPARE(ic.updateReceived, true); +#endif } QTEST_MAIN(tst_qdeclarativetextinput) -- cgit v0.12