summaryrefslogtreecommitdiff
path: root/src/controls/SpinBox.qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@digia.com>2013-11-13 11:48:15 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-15 19:00:32 +0100
commit5b38d395a821967b48406faf18f638e252d627fa (patch)
tree95957b585fdca1d023807d5bbe8ee2498754e70e /src/controls/SpinBox.qml
parentfc710d6a3548f218f853adb2f2cb908398815be6 (diff)
downloadqtquickcontrols-5b38d395a821967b48406faf18f638e252d627fa.tar.gz
SpinBox: get active focus when up or down was pressed
This behavior also needs activeFocusOnPress was true. Task-number: QTBUG-34773 Change-Id: I681c1cb20c1803e3bf7f60af5cdf45ae3fe34dae Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/SpinBox.qml')
-rw-r--r--src/controls/SpinBox.qml5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml
index 0cc2f5a7..bba4eae1 100644
--- a/src/controls/SpinBox.qml
+++ b/src/controls/SpinBox.qml
@@ -271,6 +271,7 @@ Control {
MouseArea {
id: mouseUp
+ objectName: "mouseUp"
hoverEnabled: true
property var upRect: __panel ? __panel.upRect : null
@@ -285,6 +286,7 @@ Control {
height: upRect ? upRect.height : 0
onClicked: __increment()
+ onPressed: if (activeFocusOnPress) input.forceActiveFocus()
property bool autoincrement: false;
onReleased: autoincrement = false
@@ -296,9 +298,12 @@ Control {
MouseArea {
id: mouseDown
+ objectName: "mouseDown"
hoverEnabled: true
onClicked: __decrement()
+ onPressed: if (activeFocusOnPress) input.forceActiveFocus()
+
property var downRect: __panel ? __panel.downRect : null
anchors.left: parent.left