@@ -2,15 +2,18 @@ import QtQuick 2.0
22
33Item { // Gets parent size
44 property bool thickBars: false // Thick or thin bars
5+ property bool longBars: thickBars // Long bars
56 property bool showValue: false // Show values as numbers
67 property bool showLastValue: true // Can be used to hide last value (for 360 degree gauges)
8+ property bool absValue: false // Don't show negative numbers with -
79 property bool limitAngle: false // Limit value2angle between min & max values
810 property real valueMin: 0 // Minimum value to show
911 property real valueMax: 100 // Maximum value to show
1012 property real barValue: 10 // Value of one bar
1113 property int barsAngleMin: - 90 // Angle of minimum value, 0=west
1214 property int barsAngle: 270 // Total angle of values
1315 property real valueMultiplier: 1 // Multiplier of value labels
16+ property real fontSizeMultiplier: 1
1417
1518 readonly property int barCount: valueRange / barValue + 1
1619 readonly property real valueRange: valueMax - valueMin
@@ -37,18 +40,19 @@ Item { // Gets parent size
3740 transformOrigin: Item .Center
3841 Rectangle {
3942 color: " white"
40- width: thickBars ? 50 : 25
43+ width: longBars ? 50 : 25
4144 height: thickBars ? 15 : 5
4245 antialiasing: true
4346 }
4447 Text {
4548 x: 70
4649 visible: showValue && (showLastValue || index < barCount - 1 )
4750 color: " white"
48- font .pixelSize : Math . min (( barsItem . width / barCount) * 1.1 , 100 )
51+ font .pixelSize : 100 * fontSizeMultiplier
4952 rotation: - barItem .rotation
5053 anchors .verticalCenter : parent .verticalCenter
51- text: Math .round ((index * barValue + valueMin) / valueMultiplier)
54+ text: absValue ? Math .abs (value) : value
55+ property int value: Math .round ((index * barValue + valueMin) / valueMultiplier)
5256 }
5357 }
5458 }
0 commit comments