How to get the closed sub-window from within the CloseEvent method.
Unsolved
General and Desktop
-
I have the following application:
The
CloseEvent
method code:void PSubWindow::closeEvent(QCloseEvent *event) { if(this->property("isSaved").toBool() == false){ event->ignore(); if(QMessageBox::warning(this->parent, "Changes not saved", "Would you like to save the modifiction?", QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes){ PActions::get()->saveFile(); } event->accept(); } }
I want to get the closed sub-window before destroyed from within
CloseEvent
method to save the textual contents of that window because when closing a sub-window without to be it is the active sub-window, it saves another sub-window content. -
-
Then you'll likely have to subclass QTabWidget/QTabBar to fit your needs.
-
Yes, that could also be an alternative.