File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -566,6 +566,7 @@ CDockManager::~CDockManager()
566566 auto FloatingWidgets = d->FloatingWidgets ;
567567 for (auto FloatingWidget : FloatingWidgets)
568568 {
569+ FloatingWidget->deleteContent ();
569570 delete FloatingWidget;
570571 }
571572
Original file line number Diff line number Diff line change @@ -760,10 +760,22 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget *DockWidget) :
760760 d->DockManager ->notifyWidgetOrAreaRelocation (DockWidget);
761761}
762762
763+
763764// ============================================================================
764765CFloatingDockContainer::~CFloatingDockContainer ()
765766{
766767 ADS_PRINT (" ~CFloatingDockContainer" );
768+ if (d->DockManager )
769+ {
770+ d->DockManager ->removeFloatingWidget (this );
771+ }
772+ delete d;
773+ }
774+
775+
776+ // ============================================================================
777+ void CFloatingDockContainer::deleteContent ()
778+ {
767779 std::vector<QPointer<ads::CDockAreaWidget>> areas;
768780 for (int i = 0 ; i != dockContainer ()->dockAreaCount (); ++i)
769781 {
@@ -788,12 +800,6 @@ CFloatingDockContainer::~CFloatingDockContainer()
788800 delete ptrWdg;
789801 }
790802 }
791-
792- if (d->DockManager )
793- {
794- d->DockManager ->removeFloatingWidget (this );
795- }
796- delete d;
797803}
798804
799805// ============================================================================
Original file line number Diff line number Diff line change @@ -146,6 +146,13 @@ private Q_SLOTS:
146146 */
147147 virtual void finishDragging () override ;
148148
149+ /* *
150+ * This function deletes all dock widgets in it.
151+ * This functions should be called only from dock manager in its
152+ * destructor before deleting the floating widget
153+ */
154+ void deleteContent ();
155+
149156 /* *
150157 * Call this function if you just want to initialize the position
151158 * and size of the floating widget
You can’t perform that action at this time.
0 commit comments