diff options
Diffstat (limited to 'tests/auto/quick/qquickflickable')
-rw-r--r-- | tests/auto/quick/qquickflickable/data/resize.qml | 1 | ||||
-rw-r--r-- | tests/auto/quick/qquickflickable/tst_qquickflickable.cpp | 7 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/quick/qquickflickable/data/resize.qml b/tests/auto/quick/qquickflickable/data/resize.qml index 2f7ae7b8bb..131691d012 100644 --- a/tests/auto/quick/qquickflickable/data/resize.qml +++ b/tests/auto/quick/qquickflickable/data/resize.qml @@ -1,6 +1,7 @@ import QtQuick 2.0 Rectangle { + required property bool setRebound function resizeContent() { flick.resizeContent(600, 600, Qt.point(100, 100)) } diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index da4bf5dae3..f3659290eb 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -227,7 +227,7 @@ void tst_qquickflickable::create() { QQmlEngine engine; QQmlComponent c(&engine, testFileUrl("flickable01.qml")); - QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(c.create()); + QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(c.createWithInitialProperties({{"setRebound", false}})); QVERIFY(obj != nullptr); QCOMPARE(obj->isAtXBeginning(), true); @@ -783,9 +783,8 @@ void tst_qquickflickable::flickableDirection() void tst_qquickflickable::resizeContent() { QQmlEngine engine; - engine.rootContext()->setContextProperty("setRebound", QVariant::fromValue(false)); QQmlComponent c(&engine, testFileUrl("resize.qml")); - QQuickItem *root = qobject_cast<QQuickItem*>(c.create()); + QQuickItem *root = qobject_cast<QQuickItem*>(c.createWithInitialProperties({{"setRebound", false}})); QQuickFlickable *obj = findItem<QQuickFlickable>(root, "flick"); QVERIFY(obj != nullptr); @@ -817,7 +816,7 @@ void tst_qquickflickable::returnToBounds() QScopedPointer<QQuickView> window(new QQuickView); - window->rootContext()->setContextProperty("setRebound", setRebound); + window->setInitialProperties({{"setRebound", setRebound}}); window->setSource(testFileUrl("resize.qml")); window->show(); QVERIFY(QTest::qWaitForWindowActive(window.data())); |