DialStyle QML Type | Qt Quick Controls 1 5.12.5

Qt 5.12 | Qt Quick Controls 1 | QML Types | DialStyle QML Type

Qt 5.12.5 Reference Documentation

# DialStyle QML Type

Provides custom styling for Dial. More...

Import Statement: | import QtQuick.Controls.Styles 1.4
Since: | Qt 5.5

- List of all members, including inherited members

## Properties

- background : Component
- control : Dial
- handle : Component
- handleInset : real
- labelCount : int
- labelInset : real
- labelStepSize : real
- minorTickmark : Component
- minorTickmarkCount : int
- minorTickmarkInset : real
- outerRadius : real
- tickmark : Component
- tickmarkCount : int
- tickmarkInset : real
- tickmarkLabel : Component
- tickmarkStepSize : real

## Methods

- real valueToAngle(real value)

## Detailed Description

You can create a custom dial by replacing the following delegates:

- background

## Property Documentation

background : Component

The background of the dial.

The implicit size of the dial is taken from this component.

[read-only] control : Dial

The Dial that this style is attached to.

handle : Component

The handle of the dial.

The handle is automatically positioned within the dial, based on the handleInset and the implicit width and height of the handle itself.

handleInset : real

The distance in pixels from the outside of the dial (outerRadius) to the center of the handle.

[read-only] labelCount : int

The amount of tickmark labels displayed by the dial, calculated from labelStepSize and the control's minimumValue and maximumValue.

See also tickmarkCount and minorTickmarkCount.

labelInset : real

The distance in pixels from the outside of the dial (outerRadius) at which the center of the value marker text is drawn.

labelStepSize : real

The interval at which tickmark labels are displayed.

For example, if this property is set to `10` (the default), control.minimumValue to `0`, and control.maximumValue to `100`, the tickmark labels displayed will be 0, 10, 20, etc., to 100, along the circumference of the dial.

minorTickmark : Component

This component defines each individual minor tickmark. The position of each minor tickmark is already set; only the implicitWidth and implicitHeight need to be specified.

Each instance of this component has access to the following properties:

`readonly property int` styleData.index | The index of this tickmark.
`readonly property real` styleData.value | The value that this tickmark represents.

By default, no minor tickmark is defined.

minorTickmarkCount : int

The amount of minor tickmarks between each tickmark.

See also tickmarkCount.

minorTickmarkInset : real

The distance in pixels from the outside of the dial (outerRadius) at which the outermost point of the minor tickmark line is drawn.

[read-only] outerRadius : real

The distance from the center of the dial to the outer edge of the dial.

This property is useful for determining the size of the various components of the style, in order to ensure that they are scaled proportionately when the dial is resized.

tickmark : Component

This component defines each individual tickmark. The position of each tickmark is already set; only the implicitWidth and implicitHeight need to be specified.

Each instance of this component has access to the following properties:

`readonly property int` styleData.index | The index of this tickmark.
`readonly property real` styleData.value | The value that this tickmark represents.

[read-only] tickmarkCount : int

The amount of tickmarks displayed by the dial, calculated from tickmarkStepSize and the control's minimumValue and maximumValue.

See also minorTickmarkCount.

tickmarkInset : real

The distance in pixels from the outside of the dial (outerRadius) at which the outermost point of the tickmark line is drawn.

tickmarkLabel : Component

This defines the text of each tickmark label on the dial.

Each instance of this component has access to the following properties:

`readonly property int` styleData.index | The index of this label.
`readonly property real` styleData.value | The value that this label represents.

By default, no label is defined.

tickmarkStepSize : real

The interval at which tickmarks are displayed.

For example, if this property is set to `10`, control.minimumValue to `0`, and control.maximumValue to `100`, the tickmarks displayed will be 0, 10, 20, etc., to 100, along the circumference of the dial.

## Method Documentation

real valueToAngle(real value)

Returns value as an angle in degrees.

This function is useful for custom drawing or positioning of items in the style's components. For example, it can be used to calculate the angles at which to draw an arc around the dial indicating the safe range of values.