Further move onCloseEvent to base class

So that it can be reused by MDI layouts too
This commit is contained in:
Sergio Martins
2022-03-09 14:58:35 +00:00
parent 3454b67a45
commit 01cc915734
4 changed files with 14 additions and 14 deletions

View File

@@ -302,3 +302,15 @@ LayoutSaver::MultiSplitter LayoutWidget::serialize() const
return l;
}
void LayoutWidget::onCloseEvent(QCloseEvent *e)
{
e->accept(); // Accepted by default (will close unless ignored)
const Frame::List frames = this->frames();
for (Frame *frame : frames) {
qApp->sendEvent(frame, e);
if (!e->isAccepted())
break; // Stop when the first frame prevents closing
}
}