-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCircleView.qml
More file actions
43 lines (34 loc) · 1.08 KB
/
Copy pathCircleView.qml
File metadata and controls
43 lines (34 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import QtQuick 2.7
Item {
id: root
implicitWidth: 600
implicitHeight: 200
property alias count: pathView.count
property alias currentIndex: pathView.currentIndex
property alias currentItem: pathView.currentItem
property alias dragging: pathView.dragging
// visibleItemCount must be an odd number
property int visibleItemCount: 1
property variant model
property Component delegate
PathView {
id: pathView
anchors.fill: parent
dragMargin: height /2
model: root.model
delegate: root.delegate
path: Path {
startX: -pathView.width / 2
startY: pathView.height / 2
PathLine {
x: pathView.pathItemCount * pathView.width - pathView.width / 2
y: pathView.height / 2
}
}
pathItemCount: visibleItemCount + 1
// make currently selected always in the middle of path
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
clip: true
}
}