diff --git a/kcm/src/declarative/qmlscreen.h b/kcm/src/declarative/qmlscreen.h --- a/kcm/src/declarative/qmlscreen.h +++ b/kcm/src/declarative/qmlscreen.h @@ -52,9 +52,6 @@ READ outputScale NOTIFY outputScaleChanged) - Q_PROPERTY(QQmlEngine* engine - MEMBER m_engine) - public: explicit QMLScreen(QQuickItem *parent = nullptr); @@ -72,7 +69,6 @@ void setConfig(const KScreen::ConfigPtr &config); void updateOutputsPlacement(); - void setEngine(QQmlEngine* engine); void setActiveOutput(QMLOutput *output); @@ -109,7 +105,6 @@ int m_connectedOutputsCount = 0; int m_enabledOutputsCount = 0; - QQmlEngine* m_engine = nullptr; QMLOutput *m_leftmost = nullptr; QMLOutput *m_topmost = nullptr; QMLOutput *m_rightmost = nullptr; diff --git a/kcm/src/declarative/qmlscreen.cpp b/kcm/src/declarative/qmlscreen.cpp --- a/kcm/src/declarative/qmlscreen.cpp +++ b/kcm/src/declarative/qmlscreen.cpp @@ -76,9 +76,7 @@ void QMLScreen::addOutput(const KScreen::OutputPtr &output) { - //QQuickItem *container = findChild(QLatin1String("outputContainer")); - - QMLOutputComponent comp(m_engine, this); + QMLOutputComponent comp(qmlEngine(this), this); QMLOutput *qmloutput = comp.createForOutput(output); if (!qmloutput) { qWarning() << "Failed to create QMLOutput"; @@ -344,8 +342,3 @@ qmlOutput->blockSignals(false); } } - -void QMLScreen::setEngine(QQmlEngine* engine) -{ - m_engine = engine; -} diff --git a/kcm/src/widget.cpp b/kcm/src/widget.cpp --- a/kcm/src/widget.cpp +++ b/kcm/src/widget.cpp @@ -187,8 +187,6 @@ if (!mScreen) { return; } - mScreen->setEngine(ui->quickWidget->engine()); - connect(mScreen, &QMLScreen::focusedOutputChanged, this, &Widget::slotFocusedOutputChanged); connect(rootObject->findChild(QStringLiteral("identifyButton")), SIGNAL(clicked()),