PDA

View Full Version : Close all windows



nowire75
30th October 2007, 09:51
Hi,

I have this problem: when I start my program, I have a main window, after I open a new window (QDialog and QMainWindow), and I have two or more windows on my screen.
I want to close all windows when I close the main window...

high_flyer
30th October 2007, 11:44
QMdiArea::closeAllSubWindows() (http://doc.trolltech.com/4.3/qmdiarea.html#closeAllSubWindows)

nowire75
30th October 2007, 12:17
Hi high_flyer,

I not have a MDI application....

high_flyer
30th October 2007, 12:25
in that case you need to re implement closeEvent() of your main window.

marcel
30th October 2007, 12:28
What about calling QApplication::closeAllWindows? It is a static slot.