diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquickitem/tst_qquickitem.cpp | 8 | ||||
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 8 | ||||
-rw-r--r-- | tests/auto/quick/shared/viewtestutil.cpp | 11 | ||||
-rw-r--r-- | tests/auto/quick/touchmouse/tst_touchmouse.cpp | 14 |
4 files changed, 25 insertions, 16 deletions
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp index 7860f5677a..3d6044ee9b 100644 --- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp @@ -1600,6 +1600,10 @@ void tst_qquickitem::hoverEvent() QQuickWindow *window = new QQuickWindow(); window->resize(200, 200); window->show(); + QTest::qWaitForWindowExposed(window); +#if QT_CONFIG(cursor) // Get the cursor out of the way. + QCursor::setPos(window->geometry().topRight() + QPoint(100, 100)); +#endif HoverItem *item = new HoverItem; item->setSize(QSizeF(100, 100)); @@ -1641,6 +1645,10 @@ void tst_qquickitem::hoverEventInParent() QQuickWindow window; window.resize(200, 200); window.show(); + QTest::qWaitForWindowExposed(&window); +#if QT_CONFIG(cursor) // Get the cursor out of the way. + QCursor::setPos(window.geometry().topRight() + QPoint(100, 100)); +#endif HoverItem *parentItem = new HoverItem(window.contentItem()); parentItem->setSize(QSizeF(200, 200)); diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 7fe8d94c74..05fda64654 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -1137,7 +1137,7 @@ void tst_qquickwindow::mergeTouchPointLists() for (const auto &item : list2) b.append(item.get()); - auto targetList = windowPrivate->mergePointerTargets(a, b); + auto targetList = windowPrivate->deliveryAgentPrivate()->mergePointerTargets(a, b); QCOMPARE(targetList, expected); } @@ -1760,13 +1760,13 @@ void tst_qquickwindow::focusReason() secondItem->setParentItem(window->contentItem()); firstItem->forceActiveFocus(Qt::OtherFocusReason); - QCOMPARE(QQuickWindowPrivate::get(window)->lastFocusReason, Qt::OtherFocusReason); + QCOMPARE(QQuickWindowPrivate::get(window)->deliveryAgentPrivate()->lastFocusReason, Qt::OtherFocusReason); secondItem->forceActiveFocus(Qt::TabFocusReason); - QCOMPARE(QQuickWindowPrivate::get(window)->lastFocusReason, Qt::TabFocusReason); + QCOMPARE(QQuickWindowPrivate::get(window)->deliveryAgentPrivate()->lastFocusReason, Qt::TabFocusReason); firstItem->forceActiveFocus(Qt::BacktabFocusReason); - QCOMPARE(QQuickWindowPrivate::get(window)->lastFocusReason, Qt::BacktabFocusReason); + QCOMPARE(QQuickWindowPrivate::get(window)->deliveryAgentPrivate()->lastFocusReason, Qt::BacktabFocusReason); } diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/tests/auto/quick/shared/viewtestutil.cpp index 5f84147792..5d9e6ba8dc 100644 --- a/tests/auto/quick/shared/viewtestutil.cpp +++ b/tests/auto/quick/shared/viewtestutil.cpp @@ -35,8 +35,9 @@ #include <QtTest/QTest> -#include <private/qquickwindow_p.h> -#include <private/qquickitemview_p_p.h> +#include <QtQuick/private/qquickdeliveryagent_p_p.h> +#include <QtQuick/private/qquickitemview_p_p.h> +#include <QtQuick/private/qquickwindow_p.h> QT_BEGIN_NAMESPACE @@ -460,10 +461,10 @@ namespace QQuickTouchUtils { void flush(QQuickWindow *window) { if (!window) return; - QQuickWindowPrivate *wd = QQuickWindowPrivate::get(window); - if (!wd || !wd->delayedTouch) + QQuickDeliveryAgentPrivate *da = QQuickWindowPrivate::get(window)->deliveryAgentPrivate(); + if (!da || !da->delayedTouch) return; - wd->deliverDelayedTouchEvent(); + da->deliverDelayedTouchEvent(); } } diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp index 33698b4141..ef0df0cddb 100644 --- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp +++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp @@ -194,7 +194,7 @@ public: switch (transition) { case QPointingDevice::GrabTransition::GrabExclusive: exclusiveGrabber = grabber; - fromMouseEvent = event && QQuickWindowPrivate::isMouseEvent(event); + fromMouseEvent = event && QQuickDeliveryAgentPrivate::isMouseEvent(event); canceled = false; break; case QPointingDevice::GrabTransition::UngrabExclusive: @@ -641,7 +641,7 @@ void tst_TouchMouse::buttonOnFlickable() QCOMPARE(eventItem1->eventList.at(0).type, QEvent::MouseButtonPress); QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(&window); - QVERIFY(windowPriv->touchMouseId != -1); + QVERIFY(windowPriv->deliveryAgentPrivate()->touchMouseId != -1); auto devPriv = QPointingDevicePrivate::get(device); QCOMPARE(devPriv->pointById(0)->exclusiveGrabber, eventItem1); QCOMPARE(grabMonitor.exclusiveGrabber, eventItem1); @@ -662,7 +662,7 @@ void tst_TouchMouse::buttonOnFlickable() QCOMPARE(eventItem1->eventList.at(3).type, QEvent::UngrabMouse); QCOMPARE(grabMonitor.exclusiveGrabber, flickable); - QVERIFY(windowPriv->touchMouseId != -1); + QVERIFY(windowPriv->deliveryAgentPrivate()->touchMouseId != -1); QCOMPARE(devPriv->pointById(0)->exclusiveGrabber, flickable); QTest::touchEvent(&window, device).release(0, p1, &window); @@ -696,7 +696,7 @@ void tst_TouchMouse::touchButtonOnFlickable() QCOMPARE(eventItem2->eventList.at(0).type, QEvent::TouchBegin); QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(&window); - QVERIFY(windowPriv->touchMouseId == -1); + QVERIFY(windowPriv->deliveryAgentPrivate()->touchMouseId == -1); auto devPriv = QPointingDevicePrivate::get(device); QCOMPARE(devPriv->pointById(0)->exclusiveGrabber, eventItem2); QCOMPARE(grabMonitor.exclusiveGrabber, eventItem2); @@ -720,7 +720,7 @@ void tst_TouchMouse::touchButtonOnFlickable() QCOMPARE(eventItem2->eventList.at(1).type, QEvent::TouchUpdate); QCOMPARE(grabMonitor.exclusiveGrabber, flickable); // both EventItem and Flickable handled the actual touch, so synth-mouse doesn't happen - QCOMPARE(windowPriv->touchMouseId, -1); + QCOMPARE(windowPriv->deliveryAgentPrivate()->touchMouseId, -1); QCOMPARE(devPriv->pointById(0)->exclusiveGrabber, flickable); QVERIFY(flickable->isMovingVertically()); @@ -783,7 +783,7 @@ void tst_TouchMouse::buttonOnDelayedPressFlickable() // wait to avoid getting a double click event QTest::qWait(qApp->styleHints()->mouseDoubleClickInterval() + 10); QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(&window); - QCOMPARE(windowPriv->touchMouseId, -1); // no grabber + QCOMPARE(windowPriv->deliveryAgentPrivate()->touchMouseId, -1); // no grabber // touch press QPoint p1 = QPoint(10, 110); @@ -1535,7 +1535,7 @@ void tst_TouchMouse::implicitUngrab() QVERIFY(!eventItem->eventList.isEmpty()); QCOMPARE(eventItem->eventList.at(0).type, QEvent::UngrabMouse); QTest::touchEvent(&window, device).release(0, p1); // clean up potential state - QCOMPARE(windowPriv->touchMouseId, -1); + QCOMPARE(windowPriv->deliveryAgentPrivate()->touchMouseId, -1); eventItem->setEnabled(true); QTest::touchEvent(&window, device).press(0, p1); |