accu gauge
Solved
QML and Qt Quick
-
Hi
i want design a simple horizontal accu gauge.
Range 10 to 14 V , three colors red, yellow, green in state of voltage.
My problem begin at the range. The tickmarks will not displayed.Rectangle { x : 120 y : 200 width: 200 height: 50 color: "#494d53" Gauge { id: accu anchors.fill: parent anchors.margins: 4 orientation : Qt.Horizontal tickmarkStepSize : 5 tickmarkAlignment: QT.AlignBottom minimumValue: 10 maximumValue: 14 value: 12 style: GaugeStyle { valueBar: Rectangle { implicitWidth: 10 color: "red" } } } }
-
Solved :-)
the problem was the tickmarkStepSize : 4
Rectangle { x : 70 y : 400 width: 200 height: 50 color: "#808080" Gauge { id: accu anchors.fill: parent anchors.margins: 10 orientation : Qt.Horizontal tickmarkStepSize : 0.5 tickmarkAlignment: Qt.AlignBottom minimumValue: 11 maximumValue: 13 value: 12.6 style: GaugeStyle { valueBar: Rectangle { implicitWidth: 10 color: (accu.value <= 12) ? "red" : (accu.value <= 12.5) ? "yellow" : "green" } } } }