fix drawer radio buttons selection
This commit is contained in:
parent
626b9e1e76
commit
2c9fa10b8b
3 changed files with 30 additions and 38 deletions
|
|
@ -65,6 +65,30 @@ DrawerType2 {
|
||||||
|
|
||||||
property bool isFocusable: true
|
property bool isFocusable: true
|
||||||
|
|
||||||
|
Keys.onTabPressed: {
|
||||||
|
FocusController.nextKeyTabItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onBacktabPressed: {
|
||||||
|
FocusController.previousKeyTabItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onUpPressed: {
|
||||||
|
FocusController.nextKeyUpItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onDownPressed: {
|
||||||
|
FocusController.nextKeyDownItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onLeftPressed: {
|
||||||
|
FocusController.nextKeyLeftItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onRightPressed: {
|
||||||
|
FocusController.nextKeyRightItem()
|
||||||
|
}
|
||||||
|
|
||||||
model: LanguageModel
|
model: LanguageModel
|
||||||
currentIndex: LanguageModel.currentLanguageIndex
|
currentIndex: LanguageModel.currentLanguageIndex
|
||||||
|
|
||||||
|
|
@ -72,48 +96,10 @@ DrawerType2 {
|
||||||
id: buttonGroup
|
id: buttonGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
// activeFocusOnTab: true
|
|
||||||
// onActiveFocusChanged: {
|
|
||||||
// if (activeFocus) {
|
|
||||||
// this.currentFocusIndex = 0
|
|
||||||
// this.itemAtIndex(currentFocusIndex).forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Keys.onTabPressed: {
|
|
||||||
// if (currentFocusIndex < this.count - 1) {
|
|
||||||
// currentFocusIndex += 1
|
|
||||||
// this.itemAtIndex(currentFocusIndex).forceActiveFocus()
|
|
||||||
// } else {
|
|
||||||
// listViewFocusItem.forceActiveFocus()
|
|
||||||
// focusItem.forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Item {
|
|
||||||
// id: listViewFocusItem // TODO: delete?
|
|
||||||
// Keys.onTabPressed: {
|
|
||||||
// root.forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// onVisibleChanged: {
|
|
||||||
// if (visible) {
|
|
||||||
// listViewFocusItem.forceActiveFocus()
|
|
||||||
// focusItem.forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
implicitWidth: root.width
|
implicitWidth: root.width
|
||||||
implicitHeight: delegateContent.implicitHeight
|
implicitHeight: delegateContent.implicitHeight
|
||||||
|
|
||||||
// onActiveFocusChanged: {
|
|
||||||
// if (activeFocus) {
|
|
||||||
// radioButton.forceActiveFocus()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: delegateContent
|
id: delegateContent
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,8 @@ ListView {
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
|
property bool isFocusable: true
|
||||||
|
|
||||||
indicator: Rectangle {
|
indicator: Rectangle {
|
||||||
width: parent.width - 1
|
width: parent.width - 1
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,10 @@ PageType {
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onPressed: function(event) {
|
Keys.onPressed: function(event) {
|
||||||
|
if(event.key === Qt.Key_Tab) {
|
||||||
|
FocusController.nextKeyTabItem()
|
||||||
|
}
|
||||||
|
|
||||||
PageController.keyPressEvent(event.key)
|
PageController.keyPressEvent(event.key)
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue