I've created a Qt application that acts mostly as a daemon, but occasionally shows a dialog.
Now, I know the default behavior is to close the application when the last window closes, but for my program, I need it to continue running. How do I change the behavior of my application?
You can set the QApplication::quitOnLastWindowClosed property to false
:
...
QApplication qApp;
qApp.setQuitOnLastWindowClosed(false);
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With