on ubuntu touch. I run an application in terminal and close the application in the Application scope. The application isn't killed. And no event is caught in QQuickView.
How do I detect this close event?
on ubuntu touch. I run an application in terminal and close the application in the Application scope. The application isn't killed. And no event is caught in QQuickView.
How do I detect this close event?
The close event in QML seems to be a recent addition (Qt 5.1) so only 14.04 which provides Qt 5.2 will be able to catch such event with this kind of handler:
import QtQuick 2.1
import QtQuick.Window 2.1
Window {
onClosing: {
console.log("Bye")
}
}
Alternatively you can also use onVisibleChanged
signal handler.
Sources:
This should do the job:
MainView {
id: myApp
objectName: "myApp"
Component.onDestruction: {
console.log('~~~~~~~~~~~ bye!!! ~~~~~~~~~');
}
Best regards!