@@ -802,29 +802,33 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event)
802
802
ADS_PRINT (" CFloatingDockContainer closeEvent" );
803
803
d->setState (DraggingInactive);
804
804
event->ignore ();
805
+ if (!isClosable ())
806
+ {
807
+ return ;
808
+ }
805
809
806
- if ( isClosable ())
810
+ for ( auto DockWidget : d-> DockContainer -> openedDockWidgets ())
807
811
{
808
- auto TopLevelDockWidget = topLevelDockWidget ();
809
- if (TopLevelDockWidget && TopLevelDockWidget->features ().testFlag (CDockWidget::DockWidgetDeleteOnClose))
812
+ if (DockWidget->features ().testFlag (CDockWidget::DockWidgetDeleteOnClose))
810
813
{
811
- if (!TopLevelDockWidget->closeDockWidgetInternal ())
812
- {
813
- return ;
814
- }
814
+ DockWidget->closeDockWidgetInternal ();
815
+ }
816
+ else
817
+ {
818
+ DockWidget->toggleView (false );
815
819
}
816
-
817
- // In Qt version after 5.9.2 there seems to be a bug that causes the
818
- // QWidget::event() function to not receive any NonClientArea mouse
819
- // events anymore after a close/show cycle. The bug is reported here:
820
- // https://bugreports.qt.io/browse/QTBUG-73295
821
- // The following code is a workaround for Qt versions > 5.9.2 that seems
822
- // to work
823
- // Starting from Qt version 5.12.2 this seems to work again. But
824
- // now the QEvent::NonClientAreaMouseButtonPress function returns always
825
- // Qt::RightButton even if the left button was pressed
826
- this ->hide ();
827
820
}
821
+
822
+ // In Qt version after 5.9.2 there seems to be a bug that causes the
823
+ // QWidget::event() function to not receive any NonClientArea mouse
824
+ // events anymore after a close/show cycle. The bug is reported here:
825
+ // https://bugreports.qt.io/browse/QTBUG-73295
826
+ // The following code is a workaround for Qt versions > 5.9.2 that seems
827
+ // to work
828
+ // Starting from Qt version 5.12.2 this seems to work again. But
829
+ // now the QEvent::NonClientAreaMouseButtonPress function returns always
830
+ // Qt::RightButton even if the left button was pressed
831
+ this ->hide ();
828
832
}
829
833
830
834
// ============================================================================
0 commit comments