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)
17261726 // We do not close areas with widgets with custom close handling
17271727 if (DockArea->features (BitwiseOr).testFlag (CDockWidget::CustomCloseHandling))
17281728 {
1729- std::cout << " CDockWidget::CustomCloseHandling" << std::endl;
17301729 continue ;
17311730 }
17321731
Original file line number Diff line number Diff line change @@ -770,6 +770,21 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose)
770770
771771 if (features ().testFlag (CDockWidget::DockWidgetDeleteOnClose))
772772 {
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+ }
773788 deleteDockWidget ();
774789 }
775790 else
Original file line number Diff line number Diff line change @@ -361,13 +361,8 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event)
361361 auto TopLevelDockWidget = topLevelDockWidget ();
362362 if (TopLevelDockWidget && TopLevelDockWidget->features ().testFlag (CDockWidget::DockWidgetDeleteOnClose))
363363 {
364- if (TopLevelDockWidget->closeDockWidgetInternal ())
364+ if (! TopLevelDockWidget->closeDockWidgetInternal ())
365365 {
366- this ->deleteLater ();
367- }
368- else
369- {
370- event->ignore ();
371366 return ;
372367 }
373368 }
You can’t perform that action at this time.
0 commit comments