Class: Ruler

html.Ruler

Class representing a ruler for aligning multiple items.

The ruler has min and max properties with minimum and maximum values, respectively. By calling request with a bounding box, these properties are updated. Items call request automatically if they have the ruler property set. See Item.ruler.

new html.Ruler ()

Properties:
Name Type Description
max BoundingBox

[readonly] The maximum bounding box.

min BoundingBox

[readonly] The minimum bounding box.

Example
// both labels have the same minimum width, which matches the wider
// one of the labels
Ruler { id: labelsRuler }
Label {
    ruler: labelsRuler
    minWidth: labelsRuler.max.width
    text: "A label"
}
Label {
    ruler: labelsRuler
    minWidth: labelsRuler.max.width
    text: "Another label"
}

Extends

Methods

request (bbox)

Takes a bounding box into account for aligning the min and max properties.

Name Type Description
bbox BoundingBox

A bounding box.

reset ()

Resets the values collected by this ruler.