Skip to content

Commit 842d417

Browse files
Fixed crash when trying to make a CDockWidget floating in non-opaque mode if the CDockWidget is not floatable
1 parent 52a6435 commit 842d417

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/FloatingDragPreview.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,19 +299,17 @@ void CFloatingDragPreview::finishDragging()
299299
else
300300
{
301301
CDockWidget* DockWidget = qobject_cast<CDockWidget*>(d->Content);
302+
CDockAreaWidget* DockArea = qobject_cast<CDockAreaWidget*>(d->Content);
303+
302304
CFloatingDockContainer* FloatingWidget = nullptr;
303305

304306
if (DockWidget && DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable))
305307
{
306308
FloatingWidget = new CFloatingDockContainer(DockWidget);
307309
}
308-
else
310+
else if (DockArea && DockArea->features().testFlag(CDockWidget::DockWidgetFloatable))
309311
{
310-
CDockAreaWidget* DockArea = qobject_cast<CDockAreaWidget*>(d->Content);
311-
if (DockArea->features().testFlag(CDockWidget::DockWidgetFloatable))
312-
{
313-
FloatingWidget = new CFloatingDockContainer(DockArea);
314-
}
312+
FloatingWidget = new CFloatingDockContainer(DockArea);
315313
}
316314

317315
if (FloatingWidget)

0 commit comments

Comments
 (0)