aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/controls/material/SpinBox.qml25
-rw-r--r--tests/auto/sanity/BLACKLIST2
2 files changed, 27 insertions, 0 deletions
diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml
index 5d2044e6..0c9fe767 100644
--- a/src/imports/controls/material/SpinBox.qml
+++ b/src/imports/controls/material/SpinBox.qml
@@ -74,6 +74,31 @@ T.SpinBox {
selectedTextColor: control.Material.primaryTextColor
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
+ cursorDelegate: Rectangle {
+ id: cursor
+ color: control.Material.accentColor
+ width: 2
+ visible: control.activeFocus && contentItem.selectionStart === contentItem.selectionEnd
+
+ Connections {
+ target: contentItem
+ onCursorPositionChanged: {
+ // keep a moving cursor visible
+ cursor.opacity = 1
+ timer.restart()
+ }
+ }
+
+ Timer {
+ id: timer
+ running: control.activeFocus
+ repeat: true
+ interval: Qt.styleHints.cursorFlashTime
+ onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
+ // force the cursor visible when gaining focus
+ onRunningChanged: cursor.opacity = 1
+ }
+ }
validator: control.validator
inputMethodHints: Qt.ImhFormattedNumbersOnly
diff --git a/tests/auto/sanity/BLACKLIST b/tests/auto/sanity/BLACKLIST
index 5a000c5c..ffff0c96 100644
--- a/tests/auto/sanity/BLACKLIST
+++ b/tests/auto/sanity/BLACKLIST
@@ -1,3 +1,5 @@
+[signalHandlers:material/SpinBox.qml]
+*
[signalHandlers:material/TextArea.qml]
*
[signalHandlers:material/TextField.qml]