[Interest] Qml Window: handling close events?
Shawn.Rutledge at digia.com
Mon May 6 12:51:45 CEST 2013
On 4 May 2013, at 3:54 AM, Josh Faust wrote:
> There doesn't appear to be any way of handling Window close events in QtQuick (nor, now that I look at it, in QWindow). Am I missing something obvious?
onVisibleChanged or onVisibilityChanged perhaps? But it happens after the window is already closed, so you can do some auto-saving of data for example, but it's a bit late to pop up a FileDialog to prompt the user where to save (the FileDialog would have no visible parent window). Otherwise you could override QWindow::event() and handle the close event, but it's inconvenient to write the C++ and then change your QML to use the custom subclass, for such an expected feature. I guess we will need to think of an easier way.
More information about the Interest