mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
This commit is contained in:
parent
130b0de646
commit
0b82ff30fe
@ -1565,8 +1565,9 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
}
|
||||
|
||||
if (Dropped)
|
||||
{
|
||||
FloatingWidget->deleteLater();
|
||||
{
|
||||
// Fix https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/351
|
||||
FloatingWidget->hideAndDeleteLater();
|
||||
|
||||
// If we dropped a floating widget with only one single dock widget, then we
|
||||
// drop a top level widget that changes from floating to docked now
|
||||
|
@ -373,6 +373,7 @@ struct FloatingDockContainerPrivate
|
||||
CDockAreaWidget *SingleDockArea = nullptr;
|
||||
QPoint DragStartPos;
|
||||
bool Hiding = false;
|
||||
bool AutoHideChildren = true;
|
||||
#ifdef Q_OS_LINUX
|
||||
QWidget* MouseEventHandler = nullptr;
|
||||
CFloatingWidgetTitleBar* TitleBar = nullptr;
|
||||
@ -841,15 +842,18 @@ void CFloatingDockContainer::hideEvent(QHideEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
d->Hiding = true;
|
||||
for (auto DockArea : d->DockContainer->openedDockAreas())
|
||||
if ( d->AutoHideChildren )
|
||||
{
|
||||
for (auto DockWidget : DockArea->openedDockWidgets())
|
||||
d->Hiding = true;
|
||||
for ( auto DockArea : d->DockContainer->openedDockAreas() )
|
||||
{
|
||||
DockWidget->toggleView(false);
|
||||
for ( auto DockWidget : DockArea->openedDockWidgets() )
|
||||
{
|
||||
DockWidget->toggleView( false );
|
||||
}
|
||||
}
|
||||
d->Hiding = false;
|
||||
}
|
||||
d->Hiding = false;
|
||||
}
|
||||
|
||||
|
||||
@ -1035,6 +1039,18 @@ QList<CDockWidget*> CFloatingDockContainer::dockWidgets() const
|
||||
return d->DockContainer->dockWidgets();
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void CFloatingDockContainer::hideAndDeleteLater()
|
||||
{
|
||||
// Widget has been redocked, so it must be hidden right way (see
|
||||
// https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/351)
|
||||
// but AutoHideChildren must be set to false because "this" still contains
|
||||
// dock widgets that shall not be toggled hidden.
|
||||
d->AutoHideChildren = false;
|
||||
hide();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void CFloatingDockContainer::finishDragging()
|
||||
{
|
||||
|
@ -258,6 +258,11 @@ public:
|
||||
*/
|
||||
QList<CDockWidget*> dockWidgets() const;
|
||||
|
||||
/**
|
||||
* This function hides the floating bar instantely and delete it later.
|
||||
*/
|
||||
void hideAndDeleteLater();
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
/**
|
||||
* This is a function that responds to FloatingWidgetTitleBar::maximizeRequest()
|
||||
|
Loading…
Reference in New Issue
Block a user