diff options
-rw-r--r-- | tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/MySingleton.qml | 7 | ||||
-rw-r--r-- | tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/MySingleton.qml b/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/MySingleton.qml index 9789be8191..258667be18 100644 --- a/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/MySingleton.qml +++ b/tests/auto/qml/qqmlmoduleplugin/moduleWithQmlSingleton/MySingleton.qml @@ -1,5 +1,6 @@ pragma Singleton import QtQuick 2.0 +import Test 1.0 QtObject { property Loader _loader: Loader { @@ -7,10 +8,10 @@ QtObject { } Component.onCompleted: { - if (tracker.objectName === "first") - tracker.objectName = "second" + if (Tracker.objectName === "first") + Tracker.objectName = "second" else - tracker.objectName = "first" + Tracker.objectName = "first" //console.log("created singleton", this) } } diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp index f89cc9f24a..d2d6dc5d49 100644 --- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp @@ -777,7 +777,7 @@ void tst_qqmlmoduleplugin::multiSingleton() { QQmlEngine engine; QObject obj; - engine.rootContext()->setContextProperty("tracker", &obj); + qmlRegisterSingletonInstance("Test", 1, 0, "Tracker", &obj); engine.addImportPath(m_importsDirectory); QQmlComponent component(&engine, testFileUrl("multiSingleton.qml")); QObject *object = component.create(); |