Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Gauge Styling



  • I'm having trouble styling the tickmarkLabel of a Gauge. Following GaugeStyle ( http://doc.qt.io/qt-5/qml-qtquick-controls-styles-gaugestyle.html ) I can set the color of the ticks. Using the same method I can set the color of the tickmarkLabel as well (see below). The problem is that the Label.text content is also replaced, so the label is blank unless I specify the text property. This does show a "123" in black at each major tick! But "123" is incorrect...

        style: GaugeStyle {
            tickmarkLabel: Item {
                 Label {
                    color: "#000000"
                    //text: "123"
                }
            }
        }
    

    So is there a way to override only the tickMarkLabel's color property without replacing the entire Label object which contains the text values of each specific tick?

    includes:
    import QtQuick.Controls.Styles 1.4
    import QtQuick.Extras 1.4


  • Moderators

    @apampe

    So is there a way to override only the tickMarkLabel's color property without replacing the entire Label object which contains the text values of each specific tick?

    AFAIK, No.



  • Have you tried text: styleData.value ?


  • Moderators

    @Dan_ OP is trying to change color of the text.


Log in to reply