mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-12 16:20:25 +08:00
This commit is contained in:
parent
130b0de646
commit
0b82ff30fe
@ -1566,7 +1566,8 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
|||||||
|
|
||||||
if (Dropped)
|
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
|
// 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
|
// drop a top level widget that changes from floating to docked now
|
||||||
|
@ -373,6 +373,7 @@ struct FloatingDockContainerPrivate
|
|||||||
CDockAreaWidget *SingleDockArea = nullptr;
|
CDockAreaWidget *SingleDockArea = nullptr;
|
||||||
QPoint DragStartPos;
|
QPoint DragStartPos;
|
||||||
bool Hiding = false;
|
bool Hiding = false;
|
||||||
|
bool AutoHideChildren = true;
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
QWidget* MouseEventHandler = nullptr;
|
QWidget* MouseEventHandler = nullptr;
|
||||||
CFloatingWidgetTitleBar* TitleBar = nullptr;
|
CFloatingWidgetTitleBar* TitleBar = nullptr;
|
||||||
@ -841,15 +842,18 @@ void CFloatingDockContainer::hideEvent(QHideEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( d->AutoHideChildren )
|
||||||
|
{
|
||||||
d->Hiding = true;
|
d->Hiding = true;
|
||||||
for (auto DockArea : d->DockContainer->openedDockAreas())
|
for ( auto DockArea : d->DockContainer->openedDockAreas() )
|
||||||
{
|
{
|
||||||
for (auto DockWidget : DockArea->openedDockWidgets())
|
for ( auto DockWidget : DockArea->openedDockWidgets() )
|
||||||
{
|
{
|
||||||
DockWidget->toggleView(false);
|
DockWidget->toggleView( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d->Hiding = false;
|
d->Hiding = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1035,6 +1039,18 @@ QList<CDockWidget*> CFloatingDockContainer::dockWidgets() const
|
|||||||
return d->DockContainer->dockWidgets();
|
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()
|
void CFloatingDockContainer::finishDragging()
|
||||||
{
|
{
|
||||||
|
@ -258,6 +258,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
QList<CDockWidget*> dockWidgets() const;
|
QList<CDockWidget*> dockWidgets() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function hides the floating bar instantely and delete it later.
|
||||||
|
*/
|
||||||
|
void hideAndDeleteLater();
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
/**
|
/**
|
||||||
* This is a function that responds to FloatingWidgetTitleBar::maximizeRequest()
|
* This is a function that responds to FloatingWidgetTitleBar::maximizeRequest()
|
||||||
|
Loading…
Reference in New Issue
Block a user