Provides custom styling for Dial. 更多...
import 语句: | import QtQuick.Controls.Styles 1.4 |
Since: | Qt 5.5 |
You can create a custom dial by replacing the following delegates:
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.
The distance in pixels from the outside of the dial ( outerRadius ) to the center of the handle.
The amount of tickmark labels displayed by the dial, calculated from labelStepSize and the control's minimumValue and maximumValue .
另请参阅 tickmarkCount and minorTickmarkCount .
The distance in pixels from the outside of the dial ( outerRadius ) at which the center of the value marker text is drawn.
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.
The amount of minor tickmarks between each tickmark.
另请参阅 tickmarkCount .
The distance in pixels from the outside of the dial ( outerRadius ) at which the outermost point of the minor tickmark line is drawn.
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. |
The amount of tickmarks displayed by the dial, calculated from tickmarkStepSize and the control's minimumValue and maximumValue .
另请参阅 minorTickmarkCount .
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.
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.
返回 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.