add draggable demo

This commit is contained in:
王劲鹏
2021-06-02 09:53:58 +08:00
committed by osborn
parent dde6152972
commit 56d39d19a8
4 changed files with 48 additions and 58 deletions

View File

@@ -8,33 +8,17 @@ ApplicationWindow {
height: 800
title: qsTr("Scroll")
SwipeView {
id: view
Rectangle {
width: 200; height: 200
color: "red"
currentIndex: 0
anchors.fill: parent
Drag.active: dragArea.drag.active
Rectangle {
id: firstPage
color: 'red'
MouseArea {
id: dragArea
anchors.fill: parent
drag.target: parent
}
Rectangle {
id: secondPage
color: 'green'
}
Rectangle {
id: thirdPage
color: 'blue'
}
}
PageIndicator {
id: indicator
count: view.count
currentIndex: view.currentIndex
anchors.bottom: view.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
}