C++ Backend Charts Demo App
import QtQuick 2.0
Item {
id: root
height: Math.max(sliderHeight, view.model.count * sliderHeight)
property color lineColor: "black"
property real gripSize: 25
property real spacing: dp(10)
property real sliderHeight: itemHeight
property ListModel model: ListModel { }
anchors.topMargin: dp(5)
Component {
id: editDelegate
Rectangle {
id: delegate
width: parent.width
height: root.sliderHeight
color: "transparent"
Text {
id: text
text: name
color: "white"
anchors {
top: parent.top
bottom: parent.bottom
left: parent.left
}
font.pixelSize: fontSize
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
width: 7 * fontSize
}
Slider {
anchors {
top: parent.top
bottom: parent.bottom
left: text.right
leftMargin: dp(10)
right: parent.right
rightMargin: dp(10)
}
gripSize: root.gripSize
value: model.value
onValueChanged: view.model.setProperty(index, "value", value)
}
}
}
ListView {
id: view
anchors.fill: parent
model: root.model
delegate: editDelegate