mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Added support for delete on close to overlayed widgets
This commit is contained in:
parent
54b9a8dc50
commit
22402e79f5
@ -46,6 +46,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
||||
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
|
||||
TableDockWidget->resize(250, 150);
|
||||
TableDockWidget->setMinimumSize(200,150);
|
||||
TableDockWidget->setFeature(CDockWidget::DockWidgetDeleteOnClose, true);
|
||||
DockManager->addOverlayDockWidget(CDockWidgetSideTab::SideTabBarArea::Left, TableDockWidget);
|
||||
ui->menuView->addAction(TableDockWidget->toggleViewAction());
|
||||
|
||||
|
@ -1049,11 +1049,19 @@ void CDockAreaWidget::closeArea()
|
||||
{
|
||||
for (auto DockWidget : openedDockWidgets())
|
||||
{
|
||||
if ((DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && DockWidget->features().testFlag(CDockWidget::DockWidgetForceCloseWithArea)) ||
|
||||
DockWidget->features().testFlag(CDockWidget::CustomCloseHandling) && !isOverlayed())
|
||||
if ((DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && DockWidget->features().testFlag(CDockWidget::DockWidgetForceCloseWithArea)) ||
|
||||
DockWidget->features().testFlag(CDockWidget::CustomCloseHandling))
|
||||
{
|
||||
DockWidget->closeDockWidgetInternal();
|
||||
}
|
||||
else if (DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && isOverlayed())
|
||||
{
|
||||
DockWidget->closeDockWidgetInternal();
|
||||
}
|
||||
else
|
||||
{
|
||||
DockWidget->toggleView(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1015,6 +1015,10 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose)
|
||||
FloatingWidget->hide();
|
||||
}
|
||||
}
|
||||
if (d->DockArea && d->DockArea->isOverlayed())
|
||||
{
|
||||
d->DockArea->overlayDockContainer()->cleanupAndDelete();
|
||||
}
|
||||
deleteDockWidget();
|
||||
Q_EMIT closed();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user