aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/SpinBox.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/material/SpinBox.qml')
-rw-r--r--src/imports/controls/material/SpinBox.qml35
1 files changed, 6 insertions, 29 deletions
diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml
index 110032be..11d0f0dc 100644
--- a/src/imports/controls/material/SpinBox.qml
+++ b/src/imports/controls/material/SpinBox.qml
@@ -35,9 +35,9 @@
****************************************************************************/
import QtQuick 2.8
-import QtQuick.Templates 2.1 as T
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Material.impl 2.1
+import QtQuick.Templates 2.2 as T
+import QtQuick.Controls.Material 2.2
+import QtQuick.Controls.Material.impl 2.2
T.SpinBox {
id: control
@@ -73,35 +73,12 @@ T.SpinBox {
selectedTextColor: control.Material.foreground
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 / 2
- onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
- // force the cursor visible when gaining focus
- onRunningChanged: cursor.opacity = 1
- }
- }
+
+ cursorDelegate: CursorDelegate { }
readOnly: !control.editable
validator: control.validator
- inputMethodHints: Qt.ImhDigitsOnly
+ inputMethodHints: control.inputMethodHints
}
up.indicator: Item {