aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquickconnection/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qquickconnection/data')
-rw-r--r--tests/auto/qml/qquickconnection/data/connection-targetchange.qml25
-rw-r--r--tests/auto/qml/qquickconnection/data/connection-unknownsignals-ignored.qml8
-rw-r--r--tests/auto/qml/qquickconnection/data/connection-unknownsignals-notarget.qml7
-rw-r--r--tests/auto/qml/qquickconnection/data/connection-unknownsignals-parent.qml7
-rw-r--r--tests/auto/qml/qquickconnection/data/connection-unknownsignals.qml7
-rw-r--r--tests/auto/qml/qquickconnection/data/error-object.qml7
-rw-r--r--tests/auto/qml/qquickconnection/data/error-property.qml5
-rw-r--r--tests/auto/qml/qquickconnection/data/error-property2.qml5
-rw-r--r--tests/auto/qml/qquickconnection/data/error-syntax.qml9
-rw-r--r--tests/auto/qml/qquickconnection/data/moduleapi-target.qml22
-rw-r--r--tests/auto/qml/qquickconnection/data/test-connection.qml10
-rw-r--r--tests/auto/qml/qquickconnection/data/test-connection2.qml3
-rw-r--r--tests/auto/qml/qquickconnection/data/test-connection3.qml3
-rw-r--r--tests/auto/qml/qquickconnection/data/trimming.qml10
14 files changed, 128 insertions, 0 deletions
diff --git a/tests/auto/qml/qquickconnection/data/connection-targetchange.qml b/tests/auto/qml/qquickconnection/data/connection-targetchange.qml
new file mode 100644
index 0000000000..154c309c9c
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/connection-targetchange.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+
+Item {
+ Component {
+ id: item1
+ Item {
+ objectName: "item1"
+ }
+ }
+ Component {
+ id: item2
+ Item {
+ objectName: "item2"
+ }
+ }
+ Loader {
+ id: loader
+ sourceComponent: item1
+ }
+ Connections {
+ objectName: "connections"
+ target: loader.item
+ onWidthChanged: loader.sourceComponent = item2
+ }
+}
diff --git a/tests/auto/qml/qquickconnection/data/connection-unknownsignals-ignored.qml b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-ignored.qml
new file mode 100644
index 0000000000..05d06bda94
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-ignored.qml
@@ -0,0 +1,8 @@
+import QtQuick 2.0
+
+Item {
+ id: screen
+
+ Connections { target: screen; onNotFooBar1: {} ignoreUnknownSignals: true }
+ Connections { objectName: "connections"; onNotFooBar2: {} ignoreUnknownSignals: true }
+}
diff --git a/tests/auto/qml/qquickconnection/data/connection-unknownsignals-notarget.qml b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-notarget.qml
new file mode 100644
index 0000000000..9d25cba649
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-notarget.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; target: null; onNotFooBar: {} }
+}
diff --git a/tests/auto/qml/qquickconnection/data/connection-unknownsignals-parent.qml b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-parent.qml
new file mode 100644
index 0000000000..bcd281256f
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/connection-unknownsignals-parent.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; onFooBar: {} }
+}
diff --git a/tests/auto/qml/qquickconnection/data/connection-unknownsignals.qml b/tests/auto/qml/qquickconnection/data/connection-unknownsignals.qml
new file mode 100644
index 0000000000..ad8d4d91a8
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/connection-unknownsignals.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; target: screen; onFooBar: {} }
+}
diff --git a/tests/auto/qml/qquickconnection/data/error-object.qml b/tests/auto/qml/qquickconnection/data/error-object.qml
new file mode 100644
index 0000000000..256b2626a7
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/error-object.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+
+Item {
+ Connections {
+ onClicked: Item {}
+ }
+}
diff --git a/tests/auto/qml/qquickconnection/data/error-property.qml b/tests/auto/qml/qquickconnection/data/error-property.qml
new file mode 100644
index 0000000000..a602479783
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/error-property.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0
+
+Item {
+ Connections { fakeProperty: {} }
+}
diff --git a/tests/auto/qml/qquickconnection/data/error-property2.qml b/tests/auto/qml/qquickconnection/data/error-property2.qml
new file mode 100644
index 0000000000..8123afe707
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/error-property2.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0
+
+Item {
+ Connections { onfakeProperty: {} }
+}
diff --git a/tests/auto/qml/qquickconnection/data/error-syntax.qml b/tests/auto/qml/qquickconnection/data/error-syntax.qml
new file mode 100644
index 0000000000..16c0534b68
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/error-syntax.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+
+Item {
+ Connections {
+ onClicked {
+ onPressed: {}
+ }
+ }
+}
diff --git a/tests/auto/qml/qquickconnection/data/moduleapi-target.qml b/tests/auto/qml/qquickconnection/data/moduleapi-target.qml
new file mode 100644
index 0000000000..8803f24542
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/moduleapi-target.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import MyTestModuleApi 1.0 as MyTestModuleApi
+
+Item {
+ id: rootObject
+ objectName: "rootObject"
+ property int newIntPropValue: 12
+
+ property int moduleIntPropChangedCount: 0
+ property int moduleOtherSignalCount: 0
+
+ function setModuleIntProp() {
+ MyTestModuleApi.intProp = newIntPropValue;
+ newIntPropValue = newIntPropValue + 1;
+ }
+
+ Connections {
+ target: MyTestModuleApi
+ onIntPropChanged: moduleIntPropChangedCount = moduleIntPropChangedCount + 1;
+ onOtherSignal: moduleOtherSignalCount = moduleOtherSignalCount + 1;
+ }
+}
diff --git a/tests/auto/qml/qquickconnection/data/test-connection.qml b/tests/auto/qml/qquickconnection/data/test-connection.qml
new file mode 100644
index 0000000000..ce851fc3db
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/test-connection.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+
+Item {
+ id: screen; width: 50
+
+ property bool tested: false
+ signal testMe
+
+ Connections { target: screen; onWidthChanged: screen.tested = true }
+}
diff --git a/tests/auto/qml/qquickconnection/data/test-connection2.qml b/tests/auto/qml/qquickconnection/data/test-connection2.qml
new file mode 100644
index 0000000000..b23d2fc145
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/test-connection2.qml
@@ -0,0 +1,3 @@
+import QtQuick 2.0
+
+Connections { id: connection; target: connection; onTargetChanged: 1 == 1 }
diff --git a/tests/auto/qml/qquickconnection/data/test-connection3.qml b/tests/auto/qml/qquickconnection/data/test-connection3.qml
new file mode 100644
index 0000000000..9e88f0ff8f
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/test-connection3.qml
@@ -0,0 +1,3 @@
+import QtQuick 2.0
+
+Connections {}
diff --git a/tests/auto/qml/qquickconnection/data/trimming.qml b/tests/auto/qml/qquickconnection/data/trimming.qml
new file mode 100644
index 0000000000..6692050deb
--- /dev/null
+++ b/tests/auto/qml/qquickconnection/data/trimming.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+
+Item {
+ id: screen; width: 50
+
+ property string tested
+ signal testMe(int param1, string param2)
+
+ Connections { target: screen; onTestMe: screen.tested = param2 + param1 }
+}