Hi all,
When creating a CircularGauge, the CircularGauge element always consumes the total area as if the entire circle of the gauge were displayed, even if the minimumValue angle and maximumValueAngle combinations result in a half-circle or less.
Is there a way to force the CircularGauge element to take no more vertical room than required to display the visible portion of the gauge?
See, for example, the following image and code -- the desired outcome is that the black box stops at the bottom of the visible portion of the gauge, not where a full-circle gauge would have gone.
Thanks in advance for any advice!
gauge.png
import QtQuick 2.5
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Extras 1.4
import QtQuick.Layouts 1.1
import QtQuick.Extras.Private 1.0
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
MainForm {
anchors.fill: parent
Column {
spacing: 2
Rectangle {
width: 400
height: 200
color: "#000000"
CircularGauge {
width: 400
height: 200
style: CircularGaugeStyle {
maximumValueAngle: 90
minimumValueAngle: -90
}
}
}
Rectangle {
color: "#ccffcc"
border.color: "black"
height: 75
width: 50
}
}
}
}
import QtQuick 2.5
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Extras 1.4
import QtQuick.Layouts 1.1
import QtQuick.Extras.Private 1.0
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
MainForm {
anchors.fill: parent
Column {
spacing: 2
Rectangle {
width: 400
height: 200
color: "#000000"
CircularGauge {
width: 400
height: 200
style: CircularGaugeStyle {
maximumValueAngle: 90
minimumValueAngle: -90
}
}
}
Rectangle {
color: "#ccffcc"
border.color: "black"
height: 75
width: 50
}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks