PDA

View Full Version : how to force an exiting?



anli
31st July 2006, 10:22
I have a main application window (QMainWindow descendant). The app creates another QMainWindow descendants with a parent pointed to the main window. The aim is to exit the application when main window is closed. Now, all opened children remain opened.

What have I missed?

jpn
31st July 2006, 10:30
Check this post (http://www.qtcentre.org/forum/f-qt-programming-2/t-why-doesnt-my-dialog-window-close-when-the-mainwindow-is-closed-3112.html#2).

anli
31st July 2006, 11:40
Check this post (http://www.qtcentre.org/forum/f-qt-programming-2/t-why-doesnt-my-dialog-window-close-when-the-mainwindow-is-closed-3112.html#2).
WA-attributes are usefull, bit don't work. I have overloaded closeEvent() this way:

QMainWindow::closeEvent(event);
QApplication::exit();

It works.

vishva
31st July 2006, 12:36
hello anli,

i am also suffered by this problem .i got idea from your post . now, i am closing child window or any other widget , just call object->close() funtion via signals and slots. Its work prefectly.

Thanks