aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlsynchronizer/data/aliasVsSourceProperty.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlsynchronizer/data/aliasVsSourceProperty.qml')
-rw-r--r--tests/auto/qml/qqmlsynchronizer/data/aliasVsSourceProperty.qml43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlsynchronizer/data/aliasVsSourceProperty.qml b/tests/auto/qml/qqmlsynchronizer/data/aliasVsSourceProperty.qml
new file mode 100644
index 0000000000..212578835d
--- /dev/null
+++ b/tests/auto/qml/qqmlsynchronizer/data/aliasVsSourceProperty.qml
@@ -0,0 +1,43 @@
+// Copyright (C) 2025 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+import QtQml
+import Qt.labs.synchronizer
+
+QtObject {
+ id: root
+ objectName: "bar"
+ property string unbindable: "a"
+ property int count: 12
+
+ property int countBounces: 0
+ property int countIgnores: 0
+
+ property QtObject other: QtObject {
+ id: other
+ objectName: "foo"
+ property string unbindable: "b"
+ property double count: 13.5
+
+ onCountChanged: count = 13.5 // reject any changes to count
+ }
+
+ property Synchronizer s1: Synchronizer {
+ sourceObject: root
+ sourceProperty: "objectName"
+ property alias target: other.objectName
+ }
+
+ property Synchronizer s2: Synchronizer {
+ sourceObject: root
+ sourceProperty: "unbindable"
+ property alias target: other.unbindable
+ }
+
+ property Synchronizer s3: Synchronizer {
+ sourceObject: root
+ sourceProperty: "count"
+ property alias target: other.count
+ onValueBounced: ++root.countBounces
+ onValueIgnored: ++root.countIgnores
+ }
+}