-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNotquickList.qml
37 lines (30 loc) · 905 Bytes
/
NotquickList.qml
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
import QtQuick 2.0
ListView {
id: root
readonly property var currentObject: currentItem.myObject
property Component objectDelegate
clip: true
spacing: 2
delegate: Rectangle {
property var myObject: object
color: ListView.isCurrentItem ? "cyan" : index % 2 ? "lightblue" : "lightsteelblue"
width: parent.width
height: delegateHere.item.height + 16
Loader {
id: delegateHere
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: 8
sourceComponent: root.objectDelegate
onLoaded: {
item.object = myObject
}
}
MouseArea {
z: root.z - 1
anchors.fill: parent
onClicked: root.currentIndex = index
}
}
}