mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-12 16:20:25 +08:00
Fixed some issues with custom close handling
This commit is contained in:
parent
9af9e43a5d
commit
407af06a4a
@ -1726,7 +1726,6 @@ void CDockContainerWidget::closeOtherAreas(CDockAreaWidget* KeepOpenArea)
|
|||||||
// We do not close areas with widgets with custom close handling
|
// We do not close areas with widgets with custom close handling
|
||||||
if (DockArea->features(BitwiseOr).testFlag(CDockWidget::CustomCloseHandling))
|
if (DockArea->features(BitwiseOr).testFlag(CDockWidget::CustomCloseHandling))
|
||||||
{
|
{
|
||||||
std::cout << "CDockWidget::CustomCloseHandling" << std::endl;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -770,6 +770,21 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose)
|
|||||||
|
|
||||||
if (features().testFlag(CDockWidget::DockWidgetDeleteOnClose))
|
if (features().testFlag(CDockWidget::DockWidgetDeleteOnClose))
|
||||||
{
|
{
|
||||||
|
// If the dock widget is floating, then we check if we also need to
|
||||||
|
// delete the floating widget
|
||||||
|
if (isFloating())
|
||||||
|
{
|
||||||
|
CFloatingDockContainer* FloatingWidget = internal::findParent<
|
||||||
|
CFloatingDockContainer*>(this);
|
||||||
|
if (FloatingWidget->dockWidgets().count() == 1)
|
||||||
|
{
|
||||||
|
FloatingWidget->deleteLater();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FloatingWidget->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
deleteDockWidget();
|
deleteDockWidget();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -361,13 +361,8 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event)
|
|||||||
auto TopLevelDockWidget = topLevelDockWidget();
|
auto TopLevelDockWidget = topLevelDockWidget();
|
||||||
if (TopLevelDockWidget && TopLevelDockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose))
|
if (TopLevelDockWidget && TopLevelDockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose))
|
||||||
{
|
{
|
||||||
if (TopLevelDockWidget->closeDockWidgetInternal())
|
if (!TopLevelDockWidget->closeDockWidgetInternal())
|
||||||
{
|
{
|
||||||
this->deleteLater();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
event->ignore();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user