Or whatever suggested by Qt.
Details
- Reviewers
mart broulik - Group Reviewers
Kirigami - Commits
- R169:4622249da33e: Make application close upon Ctrl+Q
Diff Detail
- Repository
- R169 Kirigami
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/controls/AbstractApplicationWindow.qml | ||
---|---|---|
293 | StandardKey.Quit should work (in Qt 5.2 iirc) |
So, Ctrl+Q always quits without confirmation? What about having a
singal aboutToQuit(var event)
and then do:
onActivated: { var event = {accepted: false} aboutToQuit(event); if (!event.accepted) { Qt.quit(); } }
Then an app can
onAboutToQuit: { if (hasUnsavedChanges) { event.accepted = true; // ask for confirmation } }
That could be interesting but could be out of scope for the patch? There's other ways the application can be closed.
Ok, so if this is a general problem with Kirigami, fine, but needs to be addressed eventually.
I would like it done as Kai's suggestion, I would call the signal quitRequested?
about the other ways to quit, i guess it's window closing, which i don't think we can intercept in any way?
Use Window.close rather than Qt.quit
Gives the opportunity to the application to do something about the
closing
hmm, can it be intercepted since Applicationwindow can't be subclassed from c++? i can think about an ugly event filter, but ouch..