qml/SpinBoxExt: Add Navigation support

This commit is contained in:
Benjamin Arnaud 2022-04-13 16:54:24 +02:00 committed by François Cartegnie
parent 7cb89f2ba4
commit 135cc6678f
1 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,9 @@ SpinBox{
}
contentItem: TextInput {
// NOTE: This is required for InterfaceWindowHandler::applyKeyEvent.
property bool visualFocus: control.visualFocus
text: control.textFromValue(control.value, control.locale)
font: control.font
@ -62,6 +65,13 @@ SpinBox{
autoScroll: false
readOnly: !control.editable
validator: control.validator
Keys.priority: Keys.AfterItem
Keys.onPressed: Navigation.defaultKeyAction(event)
Keys.onReleased: Navigation.defaultKeyReleaseAction(event)
Navigation.parentItem: control
}
up.indicator: Rectangle {
x: parent.width - width