[Interest] Mac OS X Exit Dock Action

Jérôme Godbout jerome at bodycad.com
Wed Jan 20 22:55:00 CET 2016


Hi,
If you have a QCoreApplication or any derivated class, you could hook
yourself on the following signal:
QCoreApplication::aboutToQuit()

or could use the following on QMainWindow:
http://doc.qt.io/qt-5/qwidget.html#closeEvent

The latter allow you to catch the event and interrupt it if needed (save
before quit for example).

Jerome

On Wed, Jan 20, 2016 at 4:18 PM, Joey Kleingers <
joey.kleingers at bluequartz.net> wrote:

> Hello all,
>
> Every Qt application on Mac OS X has a built-in “Quit" action item that is
> in the menu connected to the application’s icon in the dock.  Is there a
> way to hook up a slot to that action, so that when it’s triggered, it drops
> into my own Quit slot instead of Qt’s own Quit function??  I have some
> clean-up that I do when the user quits the application, and I would like to
> hook the dock's Quit action item up to a slot that I’m already using when
> another Quit action item of mine gets triggered in the global menu bar.
>
> If this is not possible, is there another solution?  I’ve been looking all
> over the place, and haven’t seemed to find an answer to this problem.
>
> Thanks,
>
> --
> Joey Kleingers
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160120/ac3cdbd5/attachment.html>


More information about the Interest mailing list