aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp10
-rw-r--r--tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp13
2 files changed, 9 insertions, 14 deletions
diff --git a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
index 16fc63b275..b3577f1084 100644
--- a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
+++ b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
@@ -2426,10 +2426,6 @@ void tst_qsgtextedit::inputMethodComposing()
void tst_qsgtextedit::cursorRectangleSize()
{
-#ifdef QTBUG_21691
- QEXPECT_FAIL("", QTBUG_21691_MESSAGE, Abort);
- QVERIFY(false);
-#else
QSGView *canvas = new QSGView(QUrl::fromLocalFile(SRCDIR "/data/CursorRect.qml"));
QVERIFY(canvas->rootObject() != 0);
canvas->show();
@@ -2441,13 +2437,15 @@ void tst_qsgtextedit::cursorRectangleSize()
textEdit->setFocus(Qt::OtherFocusReason);
QRectF cursorRect = textEdit->positionToRectangle(textEdit->cursorPosition());
QRectF microFocusFromScene = canvas->inputMethodQuery(Qt::ImCursorRectangle).toRectF();
- QRectF microFocusFromApp= QGuiApplication::focusWidget()->inputMethodQuery(Qt::ImCursorRectangle).toRectF();
+ QInputMethodQueryEvent event(Qt::ImCursorRectangle);
+ qApp->sendEvent(qApp->inputPanel()->inputItem(), &event);
+
+ QRectF microFocusFromApp = event.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(microFocusFromScene.size(), cursorRect.size());
QCOMPARE(microFocusFromApp.size(), cursorRect.size());
delete canvas;
-#endif
}
QTEST_MAIN(tst_qsgtextedit)
diff --git a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
index 0fecb54e08..89e5b02864 100644
--- a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
+++ b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
@@ -2593,15 +2593,10 @@ void tst_qsgtextinput::inputMethodComposing()
void tst_qsgtextinput::cursorRectangleSize()
{
-#ifdef QTBUG_21691
- QEXPECT_FAIL("", QTBUG_21691_MESSAGE, Abort);
- QVERIFY(false);
-#else
QSGView *canvas = new QSGView(QUrl::fromLocalFile(SRCDIR "/data/positionAt.qml"));
QVERIFY(canvas->rootObject() != 0);
canvas->show();
- canvas->setFocus();
- QGuiApplication::setActiveWindow(canvas);
+ canvas->requestActivateWindow();
QTest::qWaitForWindowShown(canvas);
QSGTextInput *textInput = qobject_cast<QSGTextInput *>(canvas->rootObject());
@@ -2609,13 +2604,15 @@ void tst_qsgtextinput::cursorRectangleSize()
textInput->setFocus(Qt::OtherFocusReason);
QRectF cursorRect = textInput->positionToRectangle(textInput->cursorPosition());
QRectF microFocusFromScene = canvas->inputMethodQuery(Qt::ImCursorRectangle).toRectF();
- QRectF microFocusFromApp= QGuiApplication::focusWidget()->inputMethodQuery(Qt::ImCursorRectangle).toRectF();
+ QInputMethodQueryEvent event(Qt::ImCursorRectangle);
+ qApp->sendEvent(qApp->inputPanel()->inputItem(), &event);
+
+ QRectF microFocusFromApp = event.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(microFocusFromScene.size(), cursorRect.size());
QCOMPARE(microFocusFromApp.size(), cursorRect.size());
delete canvas;
-#endif
}
void tst_qsgtextinput::tripleClickSelectsAll()