fix back navigation on default focus item
This commit is contained in:
parent
c962211068
commit
db5d289edc
1 changed files with 16 additions and 22 deletions
|
|
@ -38,28 +38,22 @@ Window {
|
|||
|
||||
focus: true
|
||||
|
||||
Keys.onTabPressed: {
|
||||
Keys.onPressed: function(event) {
|
||||
switch (event.key) {
|
||||
case Qt.Key_Tab:
|
||||
case Qt.Key_Down:
|
||||
case Qt.Key_Right:
|
||||
FocusController.nextKeyTabItem()
|
||||
}
|
||||
|
||||
Keys.onBacktabPressed: {
|
||||
break
|
||||
case Qt.Key_Backtab:
|
||||
case Qt.Key_Up:
|
||||
case Qt.Key_Left:
|
||||
FocusController.previousKeyTabItem()
|
||||
break
|
||||
default:
|
||||
PageController.keyPressEvent(event.key)
|
||||
event.accepted = true
|
||||
}
|
||||
|
||||
Keys.onUpPressed: {
|
||||
FocusController.nextKeyUpItem()
|
||||
}
|
||||
|
||||
Keys.onDownPressed: {
|
||||
FocusController.nextKeyDownItem()
|
||||
}
|
||||
|
||||
Keys.onLeftPressed: {
|
||||
FocusController.nextKeyLeftItem()
|
||||
}
|
||||
|
||||
Keys.onRightPressed: {
|
||||
FocusController.nextKeyRightItem()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue