From ff4f5133daacf7282493753d6336ef5c22185fed Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 22 Apr 2024 17:43:08 +0200 Subject: [PATCH] QmlDesigner: Set proper engine ownership Change-Id: I603cb34209a231226f1ef7ccb269ab8813f2758d Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/components/componentcore/theme.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/componentcore/theme.cpp b/src/plugins/qmldesigner/components/componentcore/theme.cpp index af495fd3b56..ef618447e71 100644 --- a/src/plugins/qmldesigner/components/componentcore/theme.cpp +++ b/src/plugins/qmldesigner/components/componentcore/theme.cpp @@ -10,6 +10,7 @@ #include +#include #include #include #include @@ -18,7 +19,7 @@ #include #include #include -#include +#include static Q_LOGGING_CATEGORY(themeLog, "qtc.qmldesigner.theme", QtWarningMsg) @@ -140,7 +141,9 @@ bool Theme::highPixelDensity() const QWindow *Theme::mainWindowHandle() const { - return Core::ICore::mainWindow()->windowHandle(); + QWindow *handle = Core::ICore::mainWindow()->windowHandle(); + QQmlEngine::setObjectOwnership(handle, QJSEngine::CppOwnership); + return handle; } QPixmap Theme::getPixmap(const QString &id)