I've solved this problem by this way. (I think this is not good idea, but nothing to do)
In my project, ./android/src/org/kde/necessitas/origo/QtActivity.java i've found method onKeyUp.
Here we need catch and forward KEYCODE_BACK. In Qml and in Qt at all we have no same keycode, so we can redefine it.
int newKeyCode = keyCode;
if (keyCode == KeyEvent.KEYCODE_BACK)
newKeyCode = KeyEvent.KEYCODE_MEDIA_PREVIOUS;
}
and now call delegate with newKeyCode arg.
Now, in qml:
Keys.OnPressed
{
if (event.key == Qt.Key_MediaPrevious)
PagesStack.pop();
}
Idea with keycode redefinition was published by author of qt components for android (can't remember his name)
P.S. Sorry for my english, hope this helps
понедельник, 9 сентября 2013 г., 10:34:23 UTC+4 пользователь
inspect...@gmail.com написал:
I got the same problem. Any knows a workaround to use the backbutton in qml?