File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -1726,7 +1726,6 @@ void CDockContainerWidget::closeOtherAreas(CDockAreaWidget* KeepOpenArea)
1726
1726
// We do not close areas with widgets with custom close handling
1727
1727
if (DockArea->features (BitwiseOr).testFlag (CDockWidget::CustomCloseHandling))
1728
1728
{
1729
- std::cout << " CDockWidget::CustomCloseHandling" << std::endl;
1730
1729
continue ;
1731
1730
}
1732
1731
Original file line number Diff line number Diff line change @@ -770,6 +770,21 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose)
770
770
771
771
if (features ().testFlag (CDockWidget::DockWidgetDeleteOnClose))
772
772
{
773
+ // If the dock widget is floating, then we check if we also need to
774
+ // delete the floating widget
775
+ if (isFloating ())
776
+ {
777
+ CFloatingDockContainer* FloatingWidget = internal::findParent<
778
+ CFloatingDockContainer*>(this );
779
+ if (FloatingWidget->dockWidgets ().count () == 1 )
780
+ {
781
+ FloatingWidget->deleteLater ();
782
+ }
783
+ else
784
+ {
785
+ FloatingWidget->hide ();
786
+ }
787
+ }
773
788
deleteDockWidget ();
774
789
}
775
790
else
Original file line number Diff line number Diff line change @@ -361,13 +361,8 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event)
361
361
auto TopLevelDockWidget = topLevelDockWidget ();
362
362
if (TopLevelDockWidget && TopLevelDockWidget->features ().testFlag (CDockWidget::DockWidgetDeleteOnClose))
363
363
{
364
- if (TopLevelDockWidget->closeDockWidgetInternal ())
364
+ if (! TopLevelDockWidget->closeDockWidgetInternal ())
365
365
{
366
- this ->deleteLater ();
367
- }
368
- else
369
- {
370
- event->ignore ();
371
366
return ;
372
367
}
373
368
}
You can’t perform that action at this time.
0 commit comments