diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-08-16 14:56:31 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-08-18 11:46:11 +0200 |
commit | 43a615e309e70978711f5c2c56a9881876b96349 (patch) | |
tree | a8d0899cbc1e7775f52056fc56db58b2fcf305de /tests/auto/quick | |
parent | 6034d89bdd907d4795c19e8ac752f4eb51c82a94 (diff) | |
parent | 3513995d8fde7f002977275463fcea1b86f4a693 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
src/qml/compiler/qqmltypecompiler.cpp
src/qml/jsruntime/qv4qmlcontext.cpp
src/qml/jsruntime/qv4qobjectwrapper.cpp
src/qml/qml/qqmlcustomparser.cpp
src/qml/qml/qqmlimport.cpp
src/qml/qml/qqmlimport_p.h
src/qml/qml/qqmlmetatype.cpp
src/qml/qml/qqmlmetatype_p.h
src/qml/qml/qqmltypenamecache.cpp
src/qml/qml/qqmltypenamecache_p.h
src/qml/qml/qqmltypewrapper.cpp
src/qml/qml/qqmltypewrapper_p.h
src/qml/qml/qqmlvmemetaobject.cpp
src/qml/util/qqmladaptormodel.cpp
Change-Id: Ic959d03e6f9c328fb02710d9abbb0f27cddde131
Diffstat (limited to 'tests/auto/quick')
6 files changed, 206 insertions, 51 deletions
diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp index fedca98205..071a7b3607 100644 --- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp +++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp @@ -185,14 +185,17 @@ void tst_QQuickDropArea::containsDrag_external() QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), false); - QWindowSystemInterface::handleDrag(&window, &data, QPoint(50, 50), Qt::CopyAction); + const qreal dpr = window.devicePixelRatio(); + const QPoint nativePos1 = QPoint(50, 50) * dpr; + const QPoint nativePos2 = QPoint(150, 50) * dpr; + QWindowSystemInterface::handleDrag(&window, &data, nativePos1, Qt::CopyAction); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), true); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), true); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 1); QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 0); evaluate<void>(dropArea, "{ enterEvents = 0; exitEvents = 0 }"); - QWindowSystemInterface::handleDrag(&alternateWindow, &data, QPoint(50, 50), Qt::CopyAction); + QWindowSystemInterface::handleDrag(&alternateWindow, &data, nativePos1, Qt::CopyAction); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), false); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0); @@ -200,13 +203,13 @@ void tst_QQuickDropArea::containsDrag_external() evaluate<void>(dropArea, "{ enterEvents = 0; exitEvents = 0 }"); - QWindowSystemInterface::handleDrag(&window, &data, QPoint(150, 50), Qt::CopyAction); + QWindowSystemInterface::handleDrag(&window, &data, nativePos2, Qt::CopyAction); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), false); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0); QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 0); - QWindowSystemInterface::handleDrag(&window, &data, QPoint(50, 50), Qt::CopyAction); + QWindowSystemInterface::handleDrag(&window, &data, nativePos1, Qt::CopyAction); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), true); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), true); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 1); @@ -214,13 +217,13 @@ void tst_QQuickDropArea::containsDrag_external() evaluate<void>(dropArea, "{ enterEvents = 0; exitEvents = 0 }"); - QWindowSystemInterface::handleDrag(&window, &data, QPoint(150, 50), Qt::CopyAction); + QWindowSystemInterface::handleDrag(&window, &data, nativePos2, Qt::CopyAction); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), false); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0); QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 1); - QWindowSystemInterface::handleDrop(&window, &data, QPoint(150, 50), Qt::CopyAction); + QWindowSystemInterface::handleDrop(&window, &data, nativePos2, Qt::CopyAction); } void tst_QQuickDropArea::keys_internal() @@ -583,7 +586,8 @@ void tst_QQuickDropArea::position_external() QMimeData data; - QWindowSystemInterface::handleDrag(&window, &data, QPoint(50, 50), Qt::CopyAction); + const qreal dpr = window.devicePixelRatio(); + QWindowSystemInterface::handleDrag(&window, &data, QPoint(50, 50) * dpr, Qt::CopyAction); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 1); QCOMPARE(evaluate<int>(dropArea, "moveEvents"), 1); QCOMPARE(evaluate<qreal>(dropArea, "drag.x"), qreal(50)); @@ -594,7 +598,7 @@ void tst_QQuickDropArea::position_external() QCOMPARE(evaluate<qreal>(dropArea, "eventY"), qreal(50)); evaluate<void>(dropArea, "{ enterEvents = 0; moveEvents = 0; eventX = -1; eventY = -1 }"); - QWindowSystemInterface::handleDrag(&window, &data, QPoint(40, 50), Qt::CopyAction); + QWindowSystemInterface::handleDrag(&window, &data, QPoint(40, 50) * dpr, Qt::CopyAction); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0); QCOMPARE(evaluate<int>(dropArea, "moveEvents"), 1); QCOMPARE(evaluate<qreal>(dropArea, "drag.x"), qreal(40)); @@ -605,7 +609,7 @@ void tst_QQuickDropArea::position_external() QCOMPARE(evaluate<qreal>(dropArea, "eventY"), qreal(50)); evaluate<void>(dropArea, "{ enterEvents = 0; moveEvents = 0; eventX = -1; eventY = -1 }"); - QWindowSystemInterface::handleDrag(&window, &data, QPoint(75, 25), Qt::CopyAction); + QWindowSystemInterface::handleDrag(&window, &data, QPoint(75, 25) * dpr, Qt::CopyAction); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0); QCOMPARE(evaluate<int>(dropArea, "moveEvents"), 1); QCOMPARE(evaluate<qreal>(dropArea, "drag.x"), qreal(75)); @@ -615,7 +619,7 @@ void tst_QQuickDropArea::position_external() QCOMPARE(evaluate<qreal>(dropArea, "eventX"), qreal(75)); QCOMPARE(evaluate<qreal>(dropArea, "eventY"), qreal(25)); - QWindowSystemInterface::handleDrop(&window, &data, QPoint(75, 25), Qt::CopyAction); + QWindowSystemInterface::handleDrop(&window, &data, QPoint(75, 25) * dpr, Qt::CopyAction); } void tst_QQuickDropArea::drop_internal() diff --git a/tests/auto/quick/qquicklistview/data/strictlyenforcerange-resize.qml b/tests/auto/quick/qquicklistview/data/strictlyenforcerange-resize.qml new file mode 100644 index 0000000000..338af38475 --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/strictlyenforcerange-resize.qml @@ -0,0 +1,31 @@ +import QtQuick 2.0 + +ListView { + width: 400 + height: 400 + focus: true + + highlightRangeMode: ListView.StrictlyEnforceRange + highlightMoveVelocity: 200 + preferredHighlightBegin: 150 + preferredHighlightEnd: 150 + + property bool completed + Component.onCompleted: completed = true + + model: 10 + delegate: Item { + width: parent.width + height: ListView.isCurrentItem ? 100 : 50 + + Text { + anchors.centerIn: parent + text: index + } + + Behavior on height { + enabled: completed + SmoothedAnimation { velocity: 200 } + } + } +} diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 98c628068d..2eb87b9431 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -182,6 +182,7 @@ private slots: void snapOneItemCurrentIndexRemoveAnimation(); void QTBUG_9791(); + void QTBUG_33568(); void QTBUG_11105(); void QTBUG_21742(); @@ -3470,6 +3471,29 @@ void tst_QQuickListView::QTBUG_9791() QTRY_COMPARE(listview->contentX(), 590.0); } +void tst_QQuickListView::QTBUG_33568() +{ + QScopedPointer<QQuickView> window(createView()); + window->setSource(testFileUrl("strictlyenforcerange-resize.qml")); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); + + QQuickListView *listview = qobject_cast<QQuickListView*>(window->rootObject()); + QVERIFY(listview != 0); + + // we want to verify that the change animates smoothly, rather than jumping into place + QSignalSpy spy(listview, SIGNAL(contentYChanged())); + + listview->incrementCurrentIndex(); + QTRY_COMPARE(listview->contentY(), -100.0); + QVERIFY(spy.count() > 1); + + spy.clear(); + listview->incrementCurrentIndex(); + QTRY_COMPARE(listview->contentY(), -50.0); + QVERIFY(spy.count() > 1); +} + void tst_QQuickListView::manualHighlight() { QQuickView *window = new QQuickView(0); diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 2e20275193..9b526f80c5 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -216,6 +216,8 @@ private slots: void keypress_inputMask_data(); void keypress_inputMask(); void keypress_inputMethod_inputMask(); + void keypress_inputMask_withValidator_data(); + void keypress_inputMask_withValidator(); void hasAcceptableInputMask_data(); void hasAcceptableInputMask(); void maskCharacter_data(); @@ -6112,6 +6114,79 @@ void tst_qquicktextinput::negativeDimensions() QCOMPARE(input->height(), qreal(-1)); } +void tst_qquicktextinput::keypress_inputMask_withValidator_data() +{ + QTest::addColumn<QString>("mask"); + QTest::addColumn<qreal>("validatorMinimum"); + QTest::addColumn<qreal>("validatorMaximum"); + QTest::addColumn<int>("decimals"); + QTest::addColumn<QString>("validatorRegExp"); + QTest::addColumn<KeyList>("keys"); + QTest::addColumn<QString>("expectedText"); + QTest::addColumn<QString>("expectedDisplayText"); + + { + KeyList keys; + // inserting '1212' then two backspaces + keys << Qt::Key_Home << "1212" << Qt::Key_Backspace << Qt::Key_Backspace; + QTest::newRow("backspaceWithInt") << QString("9999;_") << 1.0 << 9999.00 << 0 << QString() + << keys << QString("12") << QString("12__"); + } + { + KeyList keys; + // inserting '12.12' then two backspaces + keys << Qt::Key_Home << "12.12" << Qt::Key_Backspace << Qt::Key_Backspace; + QTest::newRow("backspaceWithDouble") << QString("99.99;_") << 1.0 << 99.99 << 2 << QString() + << keys << QString("12.") << QString("12.__"); + } + { + KeyList keys; + // inserting '1111.11' then two backspaces + keys << Qt::Key_Home << "1111.11" << Qt::Key_Backspace << Qt::Key_Backspace; + QTest::newRow("backspaceWithRegExp") << QString("9999.99;_") << 0.0 << 0.0 << 0 + << QString("/^[-]?((\\.\\d+)|(\\d+(\\.\\d+)?))$/") + << keys << QString("1111.") << QString("1111.__"); + } +} + +void tst_qquicktextinput::keypress_inputMask_withValidator() +{ + QFETCH(QString, mask); + QFETCH(qreal, validatorMinimum); + QFETCH(qreal, validatorMaximum); + QFETCH(int, decimals); + QFETCH(QString, validatorRegExp); + QFETCH(KeyList, keys); + QFETCH(QString, expectedText); + QFETCH(QString, expectedDisplayText); + + QString componentStr = "import QtQuick 2.0\nTextInput { focus: true; inputMask: \"" + mask + "\"\n"; + if (!validatorRegExp.isEmpty()) + componentStr += "validator: RegExpValidator { regExp: " + validatorRegExp + " }\n}"; + else if (decimals > 0) + componentStr += QString("validator: DoubleValidator { bottom: %1; decimals: %2; top: %3 }\n}"). + arg(validatorMinimum).arg(decimals).arg(validatorMaximum); + else + componentStr += QString("validator: IntValidator { bottom: %1; top: %2 }\n}"). + arg((int)validatorMinimum).arg((int)validatorMaximum); + + QQmlComponent textInputComponent(&engine); + textInputComponent.setData(componentStr.toLatin1(), QUrl()); + QQuickTextInput *textInput = qobject_cast<QQuickTextInput*>(textInputComponent.create()); + QVERIFY(textInput != 0); + + QQuickWindow window; + textInput->setParentItem(window.contentItem()); + window.show(); + window.requestActivate(); + QTest::qWaitForWindowActive(&window); + QVERIFY(textInput->hasActiveFocus()); + + simulateKeys(&window, keys); + + QCOMPARE(textInput->text(), expectedText); + QCOMPARE(textInput->displayText(), expectedDisplayText); +} void tst_qquicktextinput::setInputMask_data() { diff --git a/tests/auto/quick/qquickwindow/data/windowattached.qml b/tests/auto/quick/qquickwindow/data/windowattached.qml index 9d61a02452..66083db428 100644 --- a/tests/auto/quick/qquickwindow/data/windowattached.qml +++ b/tests/auto/quick/qquickwindow/data/windowattached.qml @@ -19,7 +19,6 @@ Rectangle { property Window extraWindow: Window { objectName: "extraWindow" title: "extra window" - visible: true Text { objectName: "extraWindowText" anchors.centerIn: parent diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 2133b4d2d3..adcdca4c3c 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -886,23 +886,29 @@ void tst_qquickwindow::touchEvent_velocity() item->setPosition(QPointF(50, 50)); item->setSize(QSizeF(150, 150)); - QList<QWindowSystemInterface::TouchPoint> points; - QWindowSystemInterface::TouchPoint tp; - tp.id = 1; - tp.state = Qt::TouchPointPressed; - QPoint pos = window->mapToGlobal(item->mapToScene(QPointF(10, 10)).toPoint()); - tp.area = QRectF(pos, QSizeF(4, 4)); + QList<QTouchEvent::TouchPoint> points; + QTouchEvent::TouchPoint tp; + tp.setId(1); + tp.setState(Qt::TouchPointPressed); + const QPointF localPos = item->mapToScene(QPointF(10, 10)); + const QPointF screenPos = window->mapToGlobal(localPos.toPoint()); + tp.setPos(localPos); + tp.setScreenPos(screenPos); + tp.setEllipseDiameters(QSizeF(4, 4)); points << tp; - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); QCOMPARE(item->touchEventCount, 1); - points[0].state = Qt::TouchPointMoved; - points[0].area.adjust(5, 5, 5, 5); + points[0].setState(Qt::TouchPointMoved); + points[0].setPos(localPos + QPointF(5, 5)); + points[0].setScreenPos(screenPos + QPointF(5, 5)); QVector2D velocity(1.5, 2.5); - points[0].velocity = velocity; - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + points[0].setVelocity(velocity); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); QCOMPARE(item->touchEventCount, 2); @@ -914,17 +920,20 @@ void tst_qquickwindow::touchEvent_velocity() QMatrix4x4 transformMatrix; transformMatrix.rotate(-90, 0, 0, 1); // counterclockwise QVector2D transformedVelocity = transformMatrix.mapVector(velocity).toVector2D(); - points[0].area.adjust(5, 5, 5, 5); - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + points[0].setPos(points[0].pos() + QPointF(5, 5)); + points[0].setScreenPos(points[0].screenPos() + QPointF(5, 5)); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); QCOMPARE(item->lastVelocity, transformedVelocity); - QPoint itemLocalPos = item->mapFromScene(window->mapFromGlobal(points[0].area.center().toPoint())).toPoint(); + QPoint itemLocalPos = item->mapFromScene(points[0].pos()).toPoint(); QPoint itemLocalPosFromEvent = item->lastEvent.touchPoints[0].pos().toPoint(); QCOMPARE(itemLocalPos, itemLocalPosFromEvent); - points[0].state = Qt::TouchPointReleased; - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + points[0].setState(Qt::TouchPointReleased); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); delete item; @@ -1012,25 +1021,32 @@ void tst_qquickwindow::mouseFromTouch_basic() item->setSize(QSizeF(150, 150)); item->acceptTouchEvents = false; - QList<QWindowSystemInterface::TouchPoint> points; - QWindowSystemInterface::TouchPoint tp; - tp.id = 1; - tp.state = Qt::TouchPointPressed; - QPoint pos = window->mapToGlobal(item->mapToScene(QPointF(10, 10)).toPoint()); - tp.area = QRectF(pos, QSizeF(4, 4)); + QList<QTouchEvent::TouchPoint> points; + QTouchEvent::TouchPoint tp; + tp.setId(1); + tp.setState(Qt::TouchPointPressed); + const QPointF localPos = item->mapToScene(QPointF(10, 10)); + const QPointF screenPos = window->mapToGlobal(localPos.toPoint()); + tp.setPos(localPos); + tp.setScreenPos(screenPos); + tp.setEllipseDiameters(QSizeF(4, 4)); points << tp; - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); - points[0].state = Qt::TouchPointMoved; - points[0].area.adjust(5, 5, 5, 5); + points[0].setState(Qt::TouchPointMoved); + points[0].setPos(localPos + QPointF(5, 5)); + points[0].setScreenPos(screenPos + QPointF(5, 5)); QVector2D velocity(1.5, 2.5); - points[0].velocity = velocity; - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + points[0].setVelocity(velocity); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); - points[0].state = Qt::TouchPointReleased; - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + points[0].setState(Qt::TouchPointReleased); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); @@ -1038,7 +1054,7 @@ void tst_qquickwindow::mouseFromTouch_basic() QCOMPARE(item->mousePressNum, 1); QCOMPARE(item->mouseMoveNum, 1); QCOMPARE(item->mouseReleaseNum, 1); - QCOMPARE(item->lastMousePos.toPoint(), item->mapFromScene(window->mapFromGlobal(points[0].area.center().toPoint())).toPoint()); + QCOMPARE(item->lastMousePos.toPoint(), item->mapFromScene(points[0].pos()).toPoint()); QCOMPARE(item->lastVelocityFromMouseMove, velocity); QVERIFY((item->lastMouseCapabilityFlags & QTouchDevice::Velocity) != 0); @@ -1047,22 +1063,27 @@ void tst_qquickwindow::mouseFromTouch_basic() QMatrix4x4 transformMatrix; transformMatrix.rotate(-90, 0, 0, 1); // counterclockwise QVector2D transformedVelocity = transformMatrix.mapVector(velocity).toVector2D(); - points[0].state = Qt::TouchPointPressed; - points[0].velocity = velocity; - points[0].area = QRectF(pos, QSizeF(4, 4)); - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + points[0].setState(Qt::TouchPointPressed); + points[0].setVelocity(velocity); + tp.setPos(localPos); + tp.setScreenPos(screenPos); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); - points[0].state = Qt::TouchPointMoved; - points[0].area.adjust(5, 5, 5, 5); - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + points[0].setState(Qt::TouchPointMoved); + points[0].setPos(localPos + QPointF(5, 5)); + points[0].setScreenPos(screenPos + QPointF(5, 5)); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QGuiApplication::processEvents(); QQuickTouchUtils::flush(window); - QCOMPARE(item->lastMousePos.toPoint(), item->mapFromScene(window->mapFromGlobal(points[0].area.center().toPoint())).toPoint()); + QCOMPARE(item->lastMousePos.toPoint(), item->mapFromScene(points[0].pos()).toPoint()); QCOMPARE(item->lastVelocityFromMouseMove, transformedVelocity); - points[0].state = Qt::TouchPointReleased; - QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, points); + points[0].setState(Qt::TouchPointReleased); + QWindowSystemInterface::handleTouchEvent(window, touchDeviceWithVelocity, + QWindowSystemInterfacePrivate::toNativeTouchPoints(points, window)); QCoreApplication::processEvents(); QQuickTouchUtils::flush(window); delete item; @@ -2225,6 +2246,7 @@ void tst_qquickwindow::attachedProperty() QQuickWindow *innerWindow = view.rootObject()->findChild<QQuickWindow*>("extraWindow"); QVERIFY(innerWindow); + innerWindow->show(); innerWindow->requestActivate(); QVERIFY(QTest::qWaitForWindowActive(innerWindow)); |