PDA

View Full Version : closing dialog in hidden main Widget



Lele
6th December 2006, 09:31
Hi all,
I noticed a strange beahaviour when closing a modal dialog(but the same is for any kind of widget) child
of a hidden main widget, what happens is that if the main widget is hidden and I close the modal dialog the application quit.
This case occurs to me when my application is iconized in the tray icon, so it's hidden, and I close a custom "About" dialog,
The problem doesn't happen if the main window is visible or shown minimized.

Is there a way to bypass this behaviour?
thanks in advance

bye

wysota
6th December 2006, 09:51
You experience that behaviour because by default QApplication quits when the last window is closed. To avoid that you need to call QApplication::setQuitOnLastWindowClosed(false).

Lele
6th December 2006, 10:18
thanks a lot, easier than I thought
bye

wysota
6th December 2006, 11:35
Just remember you'll have to call QCoreApplication::quit() yourself now.