It seems like the activity catches it and removes itself from the stack.
Is it crashing? If so paste the exception.
 
 
Sent: Friday, October 07, 2016 at 1:21 PM
From: "Eddie Sutton" <eddie.of.the.s...@gmail.com>
To: "Qt Interest" <interest@qt-project.org>
Subject: [Interest] Qt 5.6.1 widget app terminates if do not accept Android back key ?
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
 
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to