Hello,
I try to study an example from Qt Docs:
http://qt-project.org/doc/qt-5.0/qtw...ndows-sdi.html
I added a destructor to its QMainWindow:
MainWindow::~MainWindow()
{
qDebug() << "Hello from Destructor!";
}
MainWindow::~MainWindow()
{
qDebug() << "Hello from Destructor!";
}
To copy to clipboard, switch view to plain text mode
and I would have expected that it prints out the message when I close the window as there is:
setAttribute(Qt::WA_DeleteOnClose);
setAttribute(Qt::WA_DeleteOnClose);
To copy to clipboard, switch view to plain text mode
But it does not print anything on window close event. It prints out the message number of times (= number of windows) when all of the windows are closed first.
Please, can anyone tell me why is this happening? How to make it print out the message on close event (or in the next loop of event loop)?
Bookmarks