From 234dbbf25567ce44a8c8e099d003f04a12f2b371 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 29 Oct 2019 16:11:21 +0100 Subject: QML Drag: Prevent crash when using image provider url For attached property objects, qmlEngine will not return an engine. However, QQuickDragAttached's parent is the object to which it is attached, and from that one we can get the engine. Fixes: QTBUG-72045 Change-Id: I40748dd11ea3eb4604c37e932b2cfd3baad6fd1f Reviewed-by: Mitch Curtis --- src/quick/items/qquickdrag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick/items/qquickdrag.cpp') diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index a900406b17..a2cb739ff2 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -442,7 +442,7 @@ void QQuickDragAttached::setImageSource(const QUrl &url) if (url.isEmpty()) { d->pixmapLoader.clear(); } else { - d->pixmapLoader.load(qmlEngine(this), url); + d->pixmapLoader.load(qmlEngine(parent()), url); } Q_EMIT imageSourceChanged(); -- cgit v1.2.3