From dad637689d919a44284473dda71121c23495dd3d Mon Sep 17 00:00:00 2001
From: Pascal Sander
Date: Wed, 13 Aug 2025 20:01:22 +0200
Subject: [PATCH] QScopedPointer removes QDrag to early and will still be
accessed in another thread. #1
---
sources/ElementsCollection/elementstreeview.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sources/ElementsCollection/elementstreeview.cpp b/sources/ElementsCollection/elementstreeview.cpp
index e84b6a3ce..00f39b529 100644
--- a/sources/ElementsCollection/elementstreeview.cpp
+++ b/sources/ElementsCollection/elementstreeview.cpp
@@ -82,7 +82,11 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location)
{
if (! location.exist()) return;
+#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
+ QDrag* drag = new QDrag(this);
+#else
QScopedPointer drag(new QDrag(this));
+#endif
QString location_str = location.toString();
QMimeData *mime_data = new QMimeData();