Force Key Navigation focus [solved]
-
My key nav moves fine moving forward through states but once I go back my key nav. stays in the previous state.
Is there a way to force the focus of the key nav?Something like
@
Keys.OnPressed {
......
.........
focus.main_menu === true
}
@here is a pseudo code for what I'm trying to do
@
Keys.onPressed:{
go to base state from state1
state1.menu.item== false
base.state.menu.itme== true
}
@I just really want to be able to control which item has the key nav. focus.
-
Hi. try to use the KeyNavigation method.
http://qt-project.org/doc/qt-4.8/qml-keynavigation.html
@
Item{
id: item1KeyNavigation.down: item2
}
Item{
id: item2
KeyNavigation.up: item1
}@
if you need to force an item to get focus you should use forceActiveFocus().
http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-item.html#forceActiveFocus-method