I can receive key events, when I set the focus:true property in the QML script and overload the focusInEvent() function, where I set forceAtiveFocus().
..
void TreeViewControl::focusInEvent(QFocusEvent * event)
{
forceActiveFocus();
}
..
MyTreeViewControlArea
{
focus:true
anchors.top: parent.top
anchors.left: parent.left
width: parent.width
height: parent.height
opacity: 0.8
}
You can find some information about focus handling in QtQuick here:
http://qt-project.org/doc/qt-5/qtquick-input-focus.html
↧