mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 23:51:33 +08:00
Fixed centralwidget example to properly close all floating widgets on main window close
This commit is contained in:
parent
899e06be1c
commit
75910e910e
@ -133,3 +133,14 @@ void CMainWindow::savePerspective()
|
|||||||
PerspectiveComboBox->setCurrentText(PerspectiveName);
|
PerspectiveComboBox->setCurrentText(PerspectiveName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================================
|
||||||
|
void CMainWindow::closeEvent(QCloseEvent* event)
|
||||||
|
{
|
||||||
|
// Delete dock manager here to delete all floating widgets. This ensures
|
||||||
|
// that all top level windows of the dock manager are properly closed
|
||||||
|
DockManager->deleteLater();
|
||||||
|
QMainWindow::closeEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@ public:
|
|||||||
CMainWindow(QWidget *parent = nullptr);
|
CMainWindow(QWidget *parent = nullptr);
|
||||||
~CMainWindow();
|
~CMainWindow();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void closeEvent(QCloseEvent* event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QAction* SavePerspectiveAction = nullptr;
|
QAction* SavePerspectiveAction = nullptr;
|
||||||
QWidgetAction* PerspectiveListAction = nullptr;
|
QWidgetAction* PerspectiveListAction = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user