SpinBox QML Type | Qt Quick Controls 1 5.15.18 (original) (raw)

Provides a spin box control. More...

Import Statement: import QtQuick.Controls 1.4
Since: Qt 5.1
Inherits: FocusScope

Properties

Signals

Detailed Description

SpinBox allows the user to choose a value by clicking the up or down buttons, or by pressing up or down on the keyboard. The user can also type the value in manually.

By default the SpinBox provides discrete values in the range [0-99] with a stepSize of 1 and 0 decimals.

Note that if you require decimal values you will need to set the decimals to a non 0 value.

SpinBox { id: spinbox decimals: 2 }

Property Documentation

activeFocusOnPress : bool

This property indicates whether the Spinbox should get active focus when pressed. The default value is true.

This property holds the position of the cursor in the SpinBox.

This property was introduced in QtQuick.Controls 1.5.

This property indicates the amount of decimals. Note that if you enter more decimals than specified, they will be truncated to the specified amount of decimal places. The default value is 0.

This property indicates the current font used by the SpinBox.

horizontalAlignment : int

This property indicates how the content is horizontally aligned within the text field.

The supported values are:

The default value is style dependent.

This property was introduced in QtQuick.Controls 1.1.

[read-only] hovered : bool

This property indicates whether the control is being hovered.

[read-only] inputMethodComposing : bool

This property holds whether the SpinBox has partial text input from an input method.

While it is composing an input method may rely on mouse or key events from the SpinBox to edit or commit the partial text. This property can be used to determine when to disable events handlers that may interfere with the correct operation of an input method.

This property was introduced in QtQuick.Controls 1.3.

This property contains the edit Menu for working with text selection. Set it to null if no menu is wanted.

This property was introduced in QtQuick.Controls 1.3.

The minimum value of the SpinBox range. The value is clamped to this value.

The default value is 0.0.

The prefix for the value. I.e "$"

This property determines if the user can select the text with the mouse.

The default value is true.

This property was introduced in QtQuick.Controls 1.3.

The amount by which the value is incremented/decremented when a spin button is pressed.

The default value is 1.0.

The suffix for the value. I.e "cm"

Signal Documentation

This signal is emitted when the Return or Enter key is pressed or the control loses focus.

The corresponding handler is onEditingFinished.

Note: The corresponding handler is onEditingFinished.

This signal was introduced in QtQuick.Controls 1.1.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.