mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-20 20:34:45 +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,10 +799,20 @@ QAbstractButton* CDockAreaWidget::titleBarButton(TitleBarButton which) const
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockAreaWidget::closeArea()
|
void CDockAreaWidget::closeArea()
|
||||||
{
|
{
|
||||||
|
// 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))
|
||||||
|
{
|
||||||
|
OpenDockWidgets[0]->deleteDockWidget();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
for (auto DockWidget : openedDockWidgets())
|
for (auto DockWidget : openedDockWidgets())
|
||||||
{
|
{
|
||||||
DockWidget->toggleView(false);
|
DockWidget->toggleView(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user