Common properties across a number of controls?

  • Is it possible to define a 'style' and then use that style across a number of controls?
    For example, if I have a number of labels and I want them all to have the same alignment and anchors like so:

    Label {
         anchors.fill: parent
         horizontalAlignment: Text.AlignHCenter
         text: "Text"

    Can I create a 'style' to specify these property values and then call that 'style' either for all controls of type Label or, if not, refer to the 'style' as a property of each Label, rather than having to specify the property values in every control.

    Hope that makes sense ? :-)

Log in to reply