From 842d417e8d446fb95d52982737a4345b7a66c312 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Mon, 27 Apr 2020 07:54:43 +0200 Subject: [PATCH] Fixed crash when trying to make a CDockWidget floating in non-opaque mode if the CDockWidget is not floatable --- src/FloatingDragPreview.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/FloatingDragPreview.cpp b/src/FloatingDragPreview.cpp index acd13be..1ed1488 100644 --- a/src/FloatingDragPreview.cpp +++ b/src/FloatingDragPreview.cpp @@ -299,19 +299,17 @@ void CFloatingDragPreview::finishDragging() else { CDockWidget* DockWidget = qobject_cast(d->Content); + CDockAreaWidget* DockArea = qobject_cast(d->Content); + CFloatingDockContainer* FloatingWidget = nullptr; if (DockWidget && DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable)) { FloatingWidget = new CFloatingDockContainer(DockWidget); } - else + else if (DockArea && DockArea->features().testFlag(CDockWidget::DockWidgetFloatable)) { - CDockAreaWidget* DockArea = qobject_cast(d->Content); - if (DockArea->features().testFlag(CDockWidget::DockWidgetFloatable)) - { - FloatingWidget = new CFloatingDockContainer(DockArea); - } + FloatingWidget = new CFloatingDockContainer(DockArea); } if (FloatingWidget)