Important: Please read the Qt Code of Conduct -

Where is the source of CircularGauge?

  • Hey,

    I want to know how QT's developers implement CircularGauge I don't know if they implement it in C++ or just made it in qml?
    In both case where is the source code?


  • Moderators

  • Dear @sierdzio it is just registration of CircularGauge. Is it implemented by qml itself or it is implemented in C++ by inheritance of QGSNode/QPainter?

    Also I have a look at CircularGauge.qml :

    Control {
        id: circularGauge
        style: Settings.styleComponent(, "CircularGaugeStyle.qml", circularGauge)
            \qmlproperty real CircularGauge::minimumValue
            This property holds the smallest value displayed by the gauge.
        property alias minimumValue: range.minimumValue
            \qmlproperty real CircularGauge::maximumValue
            This property holds the largest value displayed by the gauge.
        property alias maximumValue: range.maximumValue
            This property holds the current value displayed by the gauge, which will
            always be between \l minimumValue and \l maximumValue, inclusive.
        property alias value: range.value
            \qmlproperty real CircularGauge::stepSize
            This property holds the size of the value increments that the needle
            For example, when stepSize is \c 10 and value is \c 0, adding \c 5 to
            \l value will have no visible effect on the needle, although \l value
            will still be incremented. Adding an extra \c 5 to \l value will then
            cause the needle to point to \c 10.
        property alias stepSize: range.stepSize
            This property determines whether or not the gauge displays tickmarks,
            minor tickmarks, and labels.
            For more fine-grained control over what is displayed, the following
            style components of
            \l CircularGaugeStyle can be
                \li \l {CircularGaugeStyle::}{tickmark}
                \li \l {CircularGaugeStyle::}{minorTickmark}
                \li \l {CircularGaugeStyle::}{tickmarkLabel}
        property bool tickmarksVisible: true
        RangeModel {
            id: range
            minimumValue: 0
            maximumValue: 100
            stepSize: 0
            value: minimumValue

    Is it the whole implementation?!

  • Moderators

    See qtquickcontrols/src/extras/Styles/Flat/CircularGaugeStyle.qml

    It's implemented in QML, as I said already, and in a pretty bad way, too (2 Canvas elements...).

Log in to reply