summaryrefslogtreecommitdiff
path: root/src/controls/SpinBox.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-09-25 17:13:06 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-26 15:20:34 +0200
commitc21bc7749fb2331d92bf5c109c9225583d882582 (patch)
treef7d9c60967f24e6e78d488b61a6760a9f82ae9bc /src/controls/SpinBox.qml
parentfcf32036a301d43c8b3b825df80265226a4563b3 (diff)
downloadqtquickcontrols-c21bc7749fb2331d92bf5c109c9225583d882582.tar.gz
Add text alignment property to SpinBox and SpinBoxStyle
- Added a public alignment property - Made it possible to set the default alignment in SpinBoxStyle - Made it possible to override the default spinbox size. - Change default text alignment to AlignRight for base and mac style. Change-Id: I3d02ecb880eb2d1e9ad77725207cd88bf4fc2a89 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/SpinBox.qml')
-rw-r--r--src/controls/SpinBox.qml21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml
index b062ffe5..d2a679c4 100644
--- a/src/controls/SpinBox.qml
+++ b/src/controls/SpinBox.qml
@@ -140,6 +140,23 @@ Control {
*/
property bool activeFocusOnPress: true
+ /*! \qmlproperty enumeration horizontalAlignment
+ \since 5.2
+
+ This property indicates how the content is horizontally aligned
+ within the text field.
+
+ The supported values are:
+ \list
+ \li Qt.AlignLeft
+ \li Qt.AlignHCenter
+ \li Qt.AlignRight
+ \endlist
+
+ The default value is style dependent.
+ */
+ property int horizontalAlignment: __panel ? __panel.horizontalAlignment : Qt.AlignLeft
+
/*!
\qmlproperty bool SpinBox::hovered
@@ -223,8 +240,8 @@ Control {
focus: true
activeFocusOnPress: spinbox.activeFocusOnPress
- horizontalAlignment: __panel ? __panel.horizontalTextAlignment : Qt.AlignLeft
- verticalAlignment: __panel ? __panel.verticalTextAlignment : Qt.AlignVCenter
+ horizontalAlignment: spinbox.horizontalAlignment
+ verticalAlignment: __panel ? __panel.verticalAlignment : Qt.AlignVCenter
selectByMouse: true
validator: SpinBoxValidator {