diff options
-rw-r--r-- | tests/auto/shared/visualtestutil.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/shared/visualtestutil.h b/tests/auto/shared/visualtestutil.h index 1e530c70..122dd415 100644 --- a/tests/auto/shared/visualtestutil.h +++ b/tests/auto/shared/visualtestutil.h @@ -131,7 +131,8 @@ namespace QQuickVisualTestUtil { public: QQuickApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath, - const QStringList &qmlImportPaths = QStringList()) + const QStringList &qmlImportPaths = {}, + const QVariantMap &initialProperties = {}) { for (const auto &path : qmlImportPaths) engine.addImportPath(path); @@ -139,7 +140,7 @@ namespace QQuickVisualTestUtil QQmlComponent component(&engine); component.loadUrl(testCase->testFileUrl(testFilePath)); - QObject *rootObject = component.create(); + QObject *rootObject = component.createWithInitialProperties(initialProperties); cleanup.reset(rootObject); if (!rootObject) { errorMessage = QString::fromUtf8("Failed to create window: %1").arg(component.errorString()).toUtf8(); |