Changed demos to delete the dock manager when the main window is closes to ensure that all floating widgets als "closed" (destroyed)

This commit is contained in:
Uwe Kindler
2020-07-22 11:28:41 +02:00
parent 8443414ae3
commit 4a6d2d3514
6 changed files with 57 additions and 1 deletions

View File

@@ -51,3 +51,13 @@ MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::closeEvent(QCloseEvent *event)
{
QMainWindow::closeEvent(event);
if (m_DockManager)
{
m_DockManager->deleteLater();
}
}

View File

@@ -22,6 +22,9 @@ public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
protected:
virtual void closeEvent(QCloseEvent *event) override;
private:
Ui::MainWindow *ui;
ads::CDockManager* m_DockManager;