From 0bbd52ac6f98e7020208faa2dbd774824ed212c7 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Fri, 4 Oct 2019 15:12:35 +0200 Subject: tst_qquickflickable: avoid setContextProperty Change-Id: Iaf123e647143275cfc9efcd39a1cd5944d599972 Reviewed-by: Simon Hausmann --- tests/auto/quick/qquickflickable/tst_qquickflickable.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/auto/quick/qquickflickable/tst_qquickflickable.cpp') diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index c104eecbcd..5364530ca8 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -226,7 +226,7 @@ void tst_qquickflickable::create() { QQmlEngine engine; QQmlComponent c(&engine, testFileUrl("flickable01.qml")); - QQuickFlickable *obj = qobject_cast(c.create()); + QQuickFlickable *obj = qobject_cast(c.createWithInitialProperties({{"setRebound", false}})); QVERIFY(obj != nullptr); QCOMPARE(obj->isAtXBeginning(), true); @@ -782,9 +782,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(c.create()); + QQuickItem *root = qobject_cast(c.createWithInitialProperties({{"setRebound", false}})); QQuickFlickable *obj = findItem(root, "flick"); QVERIFY(obj != nullptr); @@ -816,7 +815,7 @@ void tst_qquickflickable::returnToBounds() QScopedPointer window(new QQuickView); - window->rootContext()->setContextProperty("setRebound", setRebound); + window->setInitialProperties({{"setRebound", setRebound}}); window->setSource(testFileUrl("resize.qml")); window->show(); QVERIFY(QTest::qWaitForWindowActive(window.data())); -- cgit v1.2.3