@@ -427,7 +427,6 @@ void DockContainerWidgetPrivate::dropIntoContainer(CFloatingDockContainer* Float
427
427
428
428
RootSplitter = Splitter;
429
429
addDockAreasToList (NewDockAreas);
430
- FloatingWidget->deleteLater ();
431
430
432
431
// If we dropped the floating widget into the main dock container that does
433
432
// not contain any dock widgets, then splitter is invisible and we need to
@@ -470,7 +469,6 @@ void DockContainerWidgetPrivate::dropIntoCenterOfSection(
470
469
}
471
470
}
472
471
TargetArea->setCurrentIndex (NewCurrentIndex);
473
- FloatingWidget->deleteLater ();
474
472
TargetArea->updateTitleBarVisibility ();
475
473
return ;
476
474
}
@@ -563,7 +561,6 @@ void DockContainerWidgetPrivate::dropIntoSection(CFloatingDockContainer* Floatin
563
561
TargetAreaSplitter->setSizes (Sizes);
564
562
}
565
563
566
- FloatingWidget->deleteLater ();
567
564
addDockAreasToList (NewDockAreas);
568
565
_this->dumpLayout ();
569
566
}
@@ -1390,6 +1387,7 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
1390
1387
CDockAreaWidget* DockArea = dockAreaAt (TargetPos);
1391
1388
auto dropArea = InvalidDockWidgetArea;
1392
1389
auto ContainerDropArea = d->DockManager ->containerOverlay ()->dropAreaUnderCursor ();
1390
+ bool Dropped = false ;
1393
1391
1394
1392
if (DockArea)
1395
1393
{
@@ -1406,6 +1404,7 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
1406
1404
{
1407
1405
ADS_PRINT (" Dock Area Drop Content: " << dropArea);
1408
1406
d->dropIntoSection (FloatingWidget, DockArea, dropArea);
1407
+ Dropped = true ;
1409
1408
}
1410
1409
}
1411
1410
@@ -1417,16 +1416,22 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
1417
1416
if (dropArea != InvalidDockWidgetArea)
1418
1417
{
1419
1418
d->dropIntoContainer (FloatingWidget, dropArea);
1419
+ Dropped = true ;
1420
1420
}
1421
1421
}
1422
1422
1423
- // If we dropped a floating widget with only one single dock widget, then we
1424
- // drop a top level widget that changes from floating to docked now
1425
- CDockWidget::emitTopLevelEventForWidget (SingleDroppedDockWidget, false );
1423
+ if (Dropped)
1424
+ {
1425
+ FloatingWidget-> deleteLater ( );
1426
1426
1427
- // If there was a top level widget before the drop, then it is not top
1428
- // level widget anymore
1429
- CDockWidget::emitTopLevelEventForWidget (SingleDockWidget, false );
1427
+ // If we dropped a floating widget with only one single dock widget, then we
1428
+ // drop a top level widget that changes from floating to docked now
1429
+ CDockWidget::emitTopLevelEventForWidget (SingleDroppedDockWidget, false );
1430
+
1431
+ // If there was a top level widget before the drop, then it is not top
1432
+ // level widget anymore
1433
+ CDockWidget::emitTopLevelEventForWidget (SingleDockWidget, false );
1434
+ }
1430
1435
}
1431
1436
1432
1437
0 commit comments