Dialer QML Type
Dialer is a phone dialer style picker component. More...
Import Statement: | import Ubuntu.Components.Pickers 1.0 |
Inherits: |
Properties
- activeFocusOnPress : bool
- centerContent : list<var>
- centerItem : Item
- handSpace : real
- hands : list<DialerHands>
- maximumValue: : real
- minimumValue : real
- minimumValue: : real
- size : real
- style : Component
Signals
- handUpdated(var hand)
Detailed Description
The Dialer component is dedicated for value selection where the value is compound of several sections, i.e. hour, minute and second, or integral and decimal values. Each section is defined by a DialerHand, which shares the same range as the dialer is having. Dialer hand visuals are placed on the same dialer disk, however this can be altered by setting different values to DialerHand propertries.
The following example shows how to create a dialer component to select a value between 0 and 50.
import QtQuick 2.4 import Ubuntu.Components.Pickers 1.0 Dialer { size: units.gu(20) minimumValue: 0 maximumValue: 50 DialerHand { id: mainHand onValueChanged: console.log(value) } }
See also DialerHand.
Property Documentation
The property specifies whether the StyledItem can gain focus on a mouse press/touch or not. When the value is true, the focus will be set on the component when the mouse is pressed over it or touched. However if one of the component's ancestor StyledItem or derived is having the property value false, the focus will not be gained automatically.
In the following example the TextField will stay focused when clicked on the red rectangle.
import QtQuick 2.4 import Ubuntu.Components 1.2 Column { width: units.gu(50) height: units.gu(100) StyledItem { objectName: "passiveScope" width: parent.width height: units.gu(30) Rectangle { anchors.fill: parent color: "red" StyledItem { objectName: "activeScope" activeFocusOnPress: true anchors.fill: parent } } } TextField { id: input text: "The input stays focus even if red box is clicked" } Component.onCompleted: input.forceActiveFocus() Connections { target: window onActiveFocusItemChanged: console.debug("focus on", window.activeFocusItem) } }
The default value is false
.
This QML property was introduced in Ubuntu.Components 1.1.
centerContent : list<var> |
The property holds the list of items to be placed inside of the center disk. Items placed inside the center disk can either be listed in this property or reparented to centerItem property.
Dialer { DialerHand { id: hand centerContent: [ Label { // [...] } // [...] ] } // [...] }
read-onlycenterItem : Item |
The property holds the component from the center of the Dialer. Items wanted to be placed into the center of the Dialer must be reparented to this component, or listed in the centerContent property.
Beside that, the property helps anchoring the center disk content to the item.
Dialer { DialerHand { id: hand Label { parent: hand.centerItem // [...] } } // [...] }
The property holds the height reserved for the dialer hands, being the distance between the outer and the inner dialer disks. This value cannot be higher than the half of the dialer size.
The property holds the list of DialerHands added to Dialer. This may be the same as the children, however will contain only DialerHand objects.
These properties define the value range the dialer hand values can take. The default values are 0 and 360.
These properties define the value range the dialer hand values can take. The default values are 0 and 360.
These properties define the value range the dialer hand values can take. The default values are 0 and 360.
The property holds the size of the dialer. The component should be sized using this property instead of using width and/or height properties. Sizing with this property it is made sure that the component will scale evenly.
style : Component |
Component instantiated immediately and placed below everything else.
Signal Documentation
handUpdated(var hand) |
The signal is emited when the hand value is updated.