From 3b2cbd9016158a6511bd2f9699d095dd60c8fc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20H=C3=B6ltt=C3=A4?= Date: Tue, 12 Mar 2019 14:18:00 +0100 Subject: Add test qml-file for testing reparenting within the same window. No testcase yet, fails for now. --- tests/reparenting2.qml | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/tests.pro | 3 ++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 tests/reparenting2.qml 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 -- cgit v1.2.3