[Interest] Qt 5.6.1 widget app terminates if do not accept Android back key ?
Eddie Sutton
eddie.of.the.spam at gmail.com
Fri Oct 7 19:21:41 CEST 2016
Has anyone seen this?
I cannot find any useful clues in adb.
The app terminates unless I add a keyReleaseEvent to accept the Key_Back.
#if defined(Q_OS_ANDROID)
///
/// Android back button kills TSR ?
///
/// Adding a keyReleaseEvent that accepts the event prevents the crash.
/// I do not understand reason why.
///
/// Ignoring the Android back button will annoy users but is better than crashing.
///
void MainWindow::keyReleaseEvent(QKeyEvent *event)
{
if( Qt::Key_Back == event->key())
{
qDebug("Android Back button");
event->setAccepted(true);
}
}
#endif
Thanks in advance,
-Ed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161007/ec92f748/attachment.html>
More information about the Interest
mailing list