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 doesn’t seem to make it call close(). Am I doing this wrong?.
Isn’t the centralwidget suppose to be destroyed?.
Or perhaps the application closes before close() can be called?.
Any other ways of doing it then?
I’d try QGuiApplication::lastWindowClosed() instead.