Qt QMainWindow at Close
Posted
by Cenoc
on Stack Overflow
See other posts from Stack Overflow
or by Cenoc
Published on 2010-06-10T17:32:00Z
Indexed on
2010/06/10
17:42 UTC
Read the original article
Hit count: 112
Hey, this may seem like a very simple question, but I want to dump some data whenever the QMainWindow closes, so I used the following piece of code:
QObject::connect(MainWindow.centralwidget, SIGNAL(destroyed()), this, SLOT(close()));
but this doesnt seem to make it call close(). Am I doing this wrong? Isnt the centralwidget suppose to be destroyed? Or perhaps the application closes before close() can be called? Any other ways of doing it then?
Thanks in advance!
© Stack Overflow or respective owner