4 id: slider; width: 340; height: 48
6 // value is read/write.
8 onValueChanged: { handle.x = 2 + (value - minimum) * slider.xMax / (maximum - minimum); }
9 property real maximum: 1
10 property real minimum: 1
11 property int xMax: slider.width - handle.width - 4
15 border.color: "white"; border.width: 0; radius: 8
17 GradientStop { position: 0.0; color: "#66343434" }
18 GradientStop { position: 1.0; color: "#66000000" }
23 id: handle; smooth: true
24 x: slider.width / 2 - handle.width / 2; y: 2; width: 30; height: slider.height-4; radius: 6
26 GradientStop { position: 0.0; color: "lightgray" }
27 GradientStop { position: 1.0; color: "gray" }
31 anchors.fill: parent; drag.target: parent
32 drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: slider.xMax+2
33 onPositionChanged: { value = (maximum - minimum) * (handle.x-2) / slider.xMax + minimum; }