diff --git a/src/private/DropArea.cpp b/src/private/DropArea.cpp index 0ba5a679..2a55a568 100644 --- a/src/private/DropArea.cpp +++ b/src/private/DropArea.cpp @@ -397,15 +397,3 @@ DockWidgetBase *DropArea::mdiDockWidgetWrapper() const return nullptr; } - -void DropArea::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 - } -} diff --git a/src/private/DropArea_p.h b/src/private/DropArea_p.h index ee117b0f..adab6685 100644 --- a/src/private/DropArea_p.h +++ b/src/private/DropArea_p.h @@ -77,8 +77,6 @@ public: /// Returns the helper dock widget for implementing DockWidget::Option_MDINestable. DockWidgetBase *mdiDockWidgetWrapper() const; - - void onCloseEvent(QCloseEvent *); private: Q_DISABLE_COPY(DropArea) friend class Frame; diff --git a/src/private/LayoutWidget.cpp b/src/private/LayoutWidget.cpp index e9845027..0e938ae5 100644 --- a/src/private/LayoutWidget.cpp +++ b/src/private/LayoutWidget.cpp @@ -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 + } +} diff --git a/src/private/LayoutWidget_p.h b/src/private/LayoutWidget_p.h index 0828267b..b48111af 100644 --- a/src/private/LayoutWidget_p.h +++ b/src/private/LayoutWidget_p.h @@ -189,6 +189,8 @@ public: virtual bool deserialize(const LayoutSaver::MultiSplitter &); LayoutSaver::MultiSplitter serialize() const; + void onCloseEvent(QCloseEvent *) override; + protected: void setRootItem(Layouting::ItemContainer *root); /**