diff options
Diffstat (limited to 'tests/auto/qml/qqmlconnections/data/bindings')
14 files changed, 159 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlconnections/data/bindings/connection-no-signal-name.qml b/tests/auto/qml/qqmlconnections/data/bindings/connection-no-signal-name.qml new file mode 100644 index 0000000000..462a9577ff --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/connection-no-signal-name.qml @@ -0,0 +1,15 @@ +import QtQuick 2.4 + +Item { + id: blaBlaBla + function hint() { + } + + Connections { + //target: blaBlaBla + //onHint: hint(); + on: true + } +} + + diff --git a/tests/auto/qml/qqmlconnections/data/bindings/connection-targetchange.qml b/tests/auto/qml/qqmlconnections/data/bindings/connection-targetchange.qml new file mode 100644 index 0000000000..154c309c9c --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/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/qqmlconnections/data/bindings/connection-unknownsignals-ignored.qml b/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals-ignored.qml new file mode 100644 index 0000000000..0780dd1509 --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals-ignored.qml @@ -0,0 +1,8 @@ +import QtQml 2.0 + +QtObject { + id: root + + property Connections c1: Connections { target: root; onNotFooBar1: {} ignoreUnknownSignals: true } + property Connections c2: Connections { objectName: "connections"; onNotFooBar2: {} ignoreUnknownSignals: true } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals-notarget.qml b/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals-notarget.qml new file mode 100644 index 0000000000..3da3e0f5d1 --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals-notarget.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property Connections c1: Connections { objectName: "connections"; target: null; onNotFooBar: {} } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals-parent.qml b/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals-parent.qml new file mode 100644 index 0000000000..2c55215579 --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals-parent.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property Connections c1: Connections { objectName: "connections"; onFooBar: {} } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals.qml b/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals.qml new file mode 100644 index 0000000000..a351016b4a --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/connection-unknownsignals.qml @@ -0,0 +1,7 @@ +import QtQml 2.0 + +QtObject { + id: screen + + property Connections c1: Connections { objectName: "connections"; target: screen; onFooBar: {} } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/disabled-at-start.qml b/tests/auto/qml/qqmlconnections/data/bindings/disabled-at-start.qml new file mode 100644 index 0000000000..1a823f87f6 --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/disabled-at-start.qml @@ -0,0 +1,14 @@ +import QtQuick 2.9 + +Item { + id: root + + property bool tested: false + signal testMe() + + Connections { + target: root + enabled: false + onTestMe: root.tested = true; + } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/override-proxy-type.qml b/tests/auto/qml/qqmlconnections/data/bindings/override-proxy-type.qml new file mode 100644 index 0000000000..80e459966b --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/override-proxy-type.qml @@ -0,0 +1,13 @@ +import QtQml 2.12 +import test.proxy 1.0 + +Proxy { + property int testEnum: 0; + id: proxy + property Connections connections: Connections { + target: proxy + onSomeSignal: testEnum = Proxy.EnumValue; + } + + Component.onCompleted: someSignal() +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/rewriteError-global.qml b/tests/auto/qml/qqmlconnections/data/bindings/rewriteError-global.qml new file mode 100644 index 0000000000..1d0b557069 --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/rewriteError-global.qml @@ -0,0 +1,8 @@ +import QtQml 2.0 +import Test 1.0 + +TestObject { + property QtObject connection: Connections { + onSignalWithGlobalName: { ran = true } + } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/rewriteError-unnamed.qml b/tests/auto/qml/qqmlconnections/data/bindings/rewriteError-unnamed.qml new file mode 100644 index 0000000000..a4849e994b --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/rewriteError-unnamed.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 +import Test 1.0 + +TestObject { + property QtObject connection: Connections { + onUnnamedArgumentSignal: { ran = true } + } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/singletontype-target.qml b/tests/auto/qml/qqmlconnections/data/bindings/singletontype-target.qml new file mode 100644 index 0000000000..7de488c2dd --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/singletontype-target.qml @@ -0,0 +1,22 @@ +import QtQml 2.0 +import MyTestSingletonType 1.0 as MyTestSingletonType + +QtObject { + id: rootObject + objectName: "rootObject" + property int newIntPropValue: 12 + + property int moduleIntPropChangedCount: 0 + property int moduleOtherSignalCount: 0 + + function setModuleIntProp() { + MyTestSingletonType.Api.intProp = newIntPropValue; + newIntPropValue = newIntPropValue + 1; + } + + property Connections c: Connections { + target: MyTestSingletonType.Api + onIntPropChanged: moduleIntPropChangedCount = moduleIntPropChangedCount + 1; + onOtherSignal: moduleOtherSignalCount = moduleOtherSignalCount + 1; + } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/test-connection-implicit.qml b/tests/auto/qml/qqmlconnections/data/bindings/test-connection-implicit.qml new file mode 100644 index 0000000000..d5aa0f102a --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/test-connection-implicit.qml @@ -0,0 +1,9 @@ +import QtQuick 2.0 + +Item { + width: 50 + + property bool tested: false + + Connections { onWidthChanged: tested = true } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/test-connection.qml b/tests/auto/qml/qqmlconnections/data/bindings/test-connection.qml new file mode 100644 index 0000000000..f44cbc047f --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/test-connection.qml @@ -0,0 +1,10 @@ +import QtQuick 2.0 + +Item { + id: screen; width: 50 + + property bool tested: false + signal testMe + + Connections { objectName: "connections"; target: screen; onWidthChanged: screen.tested = true } +} diff --git a/tests/auto/qml/qqmlconnections/data/bindings/trimming.qml b/tests/auto/qml/qqmlconnections/data/bindings/trimming.qml new file mode 100644 index 0000000000..4c37eb22af --- /dev/null +++ b/tests/auto/qml/qqmlconnections/data/bindings/trimming.qml @@ -0,0 +1,10 @@ +import QtQml 2.0 + +QtObject { + id: root + + property string tested + signal testMe(int param1, string param2) + + property Connections c: Connections { target: root; onTestMe: root.tested = param2 + param1 } +} |