File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -799,9 +799,19 @@ QAbstractButton* CDockAreaWidget::titleBarButton(TitleBarButton which) const
799
799
// ============================================================================
800
800
void CDockAreaWidget::closeArea ()
801
801
{
802
- for (auto DockWidget : openedDockWidgets ())
802
+ // If there is only one single dock widget and this widget has the
803
+ // DeleteOnClose feature, then we delete the dock widget now
804
+ auto OpenDockWidgets = openedDockWidgets ();
805
+ if (OpenDockWidgets.count () == 1 && OpenDockWidgets[0 ]->features ().testFlag (CDockWidget::DockWidgetDeleteOnClose))
806
+ {
807
+ OpenDockWidgets[0 ]->deleteDockWidget ();
808
+ }
809
+ else
803
810
{
804
- DockWidget->toggleView (false );
811
+ for (auto DockWidget : openedDockWidgets ())
812
+ {
813
+ DockWidget->toggleView (false );
814
+ }
805
815
}
806
816
}
807
817
You can’t perform that action at this time.
0 commit comments