mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-07-15 11:34:25 -04:00
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 <victoria.fischer@mbition.io>
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user