Unable to close the application in Document


I have an application which is running. From the menu of the application I open a modal dialog box. When I try to close the application from the dock preferences widget by right clicking and selecting Quit option. The application kind of hangs, and a force quit is required. The same piece of code seems to works well in windows.

In windows
We see two views in system taskbar one for application and one for modal window thats open.

We see only one view for the parent application thats all.


Is it your own modal window, or some kind of OS one (e.g. file open dialog. etc?)

Its our own modal window.

Well, if the app quits while your window is sitting in a modal loop, you’ve got the problem of unwinding your stack after the app has shut down. That’s why modal loops are frowned upon these days (and I think most OSes will probably eventually make them illegal in the long-term).

Instead of actually running a modal loop, it’s better to just launch the window in a modal state asynchronously - see Component::enterModalState()