diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index bf2243d09fc..c20f090b192 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -361,7 +361,7 @@ PropertyEditorContextObject* PropertyEditorQmlBackend::contextObject() { } QWidget *PropertyEditorQmlBackend::widget() { - return m_view; + return m_view->widget(); } void PropertyEditorQmlBackend::setSource(const QUrl& url) { diff --git a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp index 7032a26ef76..b7b356d894d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp @@ -45,10 +45,16 @@ namespace QmlDesigner { Quick2PropertyEditorView::Quick2PropertyEditorView(QWidget *parent) : - QQuickWidget(parent) + QQuickView() { - setResizeMode(QQuickWidget::SizeRootObjectToView); + setResizeMode(QQuickView::SizeRootObjectToView); Theme::setupTheme(engine()); + m_widget = QWidget::createWindowContainer(this, parent); +} + +QWidget *Quick2PropertyEditorView::widget() +{ + return m_widget; } void Quick2PropertyEditorView::registerQmlTypes() @@ -98,7 +104,7 @@ bool Quick2PropertyEditorView::event(QEvent *e) } } - return QQuickWidget::event(e); + return QQuickView::event(e); } } //QmlDesigner diff --git a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h index c2c0ba9f36f..fba3eca934b 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h +++ b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h @@ -25,22 +25,27 @@ #pragma once -#include +#include namespace QmlDesigner { -class Quick2PropertyEditorView : public QQuickWidget +class Quick2PropertyEditorView : public QQuickView { Q_OBJECT public: explicit Quick2PropertyEditorView(QWidget *parent = nullptr); + QWidget *widget(); + static void registerQmlTypes(); protected: bool event(QEvent *e) override; + +private: + QWidget *m_widget; }; } //QmlDesigner