PDA

View Full Version : How to show and close a window inside a QObject without closing it?



Momergil
12th March 2013, 11:44
Hello!

I have a software that is mainly executed from a QMainWindow class that is actually never shown (the software comprises a series fo QTimers that verifies the CPU's stats). The problem is that all times that I want to show and than close a window from this software (e.g. QMessageBox::about(...)), when this window is closed, the entire software is closed and I don't want that! I tried to eliminate the QMainWindow factor by passing all functions to a simple QObject class but the same thing happens: if I close a window, the entire software is closed.


How can I avoid that so the software will not be closed all time I want to show a popup?


Thanks,

Momergil

lanz
12th March 2013, 11:49
You may have a look at http://qt-project.org/doc/qt-4.8/qapplication.html#quitOnLastWindowClosed-prop