@@ -123,7 +123,19 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
123
123
int VisibleDockAreas = TopContainer->visibleDockAreaCount ();
124
124
ContainerOverlay->setAllowedAreas (
125
125
VisibleDockAreas > 1 ? OuterDockAreas : AllDockAreas);
126
- DockWidgetArea ContainerArea = ContainerOverlay->showOverlay (TopContainer);
126
+
127
+ DockWidgetArea ContainerArea = InvalidDockWidgetArea;
128
+ // If there is only one single visible dock area in a container, then
129
+ // it does not make sense to show a dock overlay because the dock area
130
+ // would be removed and inserted at the same position
131
+ if (VisibleDockAreas <= 1 )
132
+ {
133
+ ContainerOverlay->hideOverlay ();
134
+ }
135
+ else
136
+ {
137
+ ContainerArea = ContainerOverlay->showOverlay (TopContainer);
138
+ }
127
139
ContainerOverlay->enableDropPreview (ContainerArea != InvalidDockWidgetArea);
128
140
auto DockArea = TopContainer->dockAreaAt (GlobalPos);
129
141
if (DockArea && DockArea->isVisible () && VisibleDockAreas > 0 && DockArea != ContentSourceArea)
@@ -151,14 +163,6 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
151
163
else
152
164
{
153
165
DockAreaOverlay->hideOverlay ();
154
- // If there is only one single visible dock area in a container, then
155
- // it does not make sense to show a dock overlay because the dock area
156
- // would be removed and inserted at the same position
157
- if (VisibleDockAreas <= 1 )
158
- {
159
- ContainerOverlay->hideOverlay ();
160
- }
161
-
162
166
if (DockArea == ContentSourceArea && InvalidDockWidgetArea == ContainerDropArea)
163
167
{
164
168
DropContainer = nullptr ;
0 commit comments