aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/scriptConnectSingleton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/scriptConnectSingleton.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/scriptConnectSingleton.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/scriptConnectSingleton.qml b/tests/auto/qml/qqmlecmascript/data/scriptConnectSingleton.qml
new file mode 100644
index 0000000000..f666945b33
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/scriptConnectSingleton.qml
@@ -0,0 +1,21 @@
+import QtQuick
+import Test
+
+Item {
+ id: root
+
+ property int a: 0
+ signal mySignal
+
+ function test() {
+ MyInheritedQmlObjectSingleton.value++
+ root.a = MyInheritedQmlObjectSingleton.value
+ }
+
+ function disconnectSingleton() {
+ root.mySignal.disconnect(MyInheritedQmlObjectSingleton, root.test)
+ }
+
+ Component.onCompleted: root.mySignal.connect(MyInheritedQmlObjectSingleton,
+ root.test)
+}