aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/reparenting2.qml71
-rw-r--r--tests/tests.pro3
2 files changed, 73 insertions, 1 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
+ }
+ }
+}
diff --git a/tests/tests.pro b/tests/tests.pro
index ac192f3..ed92176 100644
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -14,4 +14,5 @@ DISTFILES += \
basics.qml \
CNRect.qml \
4WayTest.qml \
- reparenting.qml
+ reparenting.qml \
+ reparenting2.qml