mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Closing a dock area with only one single dock widget that has the DockWidgetDeleteOnCloseFeature will delete the dock widget and the area now
This commit is contained in:
parent
a45a035bb3
commit
5e230d8874
@ -799,9 +799,19 @@ QAbstractButton* CDockAreaWidget::titleBarButton(TitleBarButton which) const
|
||||
//============================================================================
|
||||
void CDockAreaWidget::closeArea()
|
||||
{
|
||||
for (auto DockWidget : openedDockWidgets())
|
||||
// If there is only one single dock widget and this widget has the
|
||||
// DeleteOnClose feature, then we delete the dock widget now
|
||||
auto OpenDockWidgets = openedDockWidgets();
|
||||
if (OpenDockWidgets.count() == 1 && OpenDockWidgets[0]->features().testFlag(CDockWidget::DockWidgetDeleteOnClose))
|
||||
{
|
||||
DockWidget->toggleView(false);
|
||||
OpenDockWidgets[0]->deleteDockWidget();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto DockWidget : openedDockWidgets())
|
||||
{
|
||||
DockWidget->toggleView(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user