aboutsummaryrefslogtreecommitdiffstats
path: root/tests/reparenting2.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/reparenting2.qml')
-rw-r--r--tests/reparenting2.qml71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/reparenting2.qml b/tests/reparenting2.qml
new file mode 100644
index 0000000..2d69cd4
--- /dev/null
+++ b/tests/reparenting2.qml
@@ -0,0 +1,71 @@
+import QtQuick 2.0
+import CursorNavigation 1.0
+import QtQuick.Controls 2.5
+
+Item {
+ width: 130
+ height: 170
+
+ CNRect {
+ x: 10
+ y: 20
+ }
+
+ CNRect {
+ x: 10
+ y: 80
+ }
+
+
+ Rectangle {
+ id: rect0
+ x: 50
+ y: 10
+ width: 70
+ height: 40
+
+ color: "blue"
+
+ FocusScope {
+ CursorNavigation.acceptsCursor: true
+ anchors.fill: parent
+
+ CNRect {
+ x: 10
+ y: 10
+ focus: true
+ }
+
+ CNRect {
+ objectName: "movableItem"
+ id: movableItem
+ x: 40
+ y: 10
+ }
+ }
+ }
+
+ Rectangle {
+ id: rect1
+ x: 50
+ y: 70
+ width: 70
+ height: 40
+
+ color: "lightblue"
+
+ CNRect {
+ x: 10
+ y: 10
+ }
+ }
+
+ Button {
+ x: 10
+ y: 120
+
+ onClicked: {
+ movableItem.parent = rect1
+ }
+ }
+}