Expose the Window interface to QML

If we are designing our UI's windows from QML, it makes sense that we
might want to configure how they're placed from the same place.

Everything was already in place but for a few technical bits which this
change adds.

Signed-off-by: Victoria Fischer <[email protected]>
This commit is contained in:
Aleix Pol Gonzalez
2023-07-13 11:23:01 +02:00
parent d6aeaef1dc
commit 143fd1755a
7 changed files with 167 additions and 1 deletions
+9
View File
@@ -186,9 +186,18 @@ Window::Window(QWindow *window)
Window *Window::get(QWindow *window)
{
if (!window) {
return nullptr;
}
auto layerShellWindow = s_map.value(window);
if (layerShellWindow) {
return layerShellWindow;
}
return new Window(window);
}
Window *Window::qmlAttachedProperties(QObject *object)
{
return get(qobject_cast<QWindow *>(object));
}