165 m_qmlContext = std::make_unique<QQmlContext>(
Scripting::self()->qmlEngine());
166 m_qmlContext->setContextProperty(QStringLiteral(
"outline"),
m_outline);
168 if (!m_qmlComponent) {
169 m_qmlComponent = std::make_unique<QQmlComponent>(
Scripting::self()->qmlEngine());
170 const QString fileName = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
171 kwinApp()->config()->group(QStringLiteral(
"Outline")).readEntry(
"QmlPath", QStringLiteral(
"kwin/outline/plasma/outline.qml")));
172 if (fileName.isEmpty()) {
173 qCDebug(KWIN_CORE) <<
"Could not locate outline.qml";
176 m_qmlComponent->loadUrl(QUrl::fromLocalFile(fileName));
177 if (m_qmlComponent->isError()) {
178 qCDebug(KWIN_CORE) <<
"Component failed to load: " << m_qmlComponent->errors();
180 m_mainItem.reset(m_qmlComponent->create(m_qmlContext.get()));
182 if (
auto w = qobject_cast<QQuickWindow *>(m_mainItem.get())) {
183 w->setProperty(
"__kwin_outline",
true);