#include "windowinterface.hpp" #include #include #include #include "proxywindow.hpp" QsWindowAttached* WindowInterface::qmlAttachedProperties(QObject* object) { auto* visualRoot = qobject_cast(object); ProxyWindowBase* proxy = nullptr; while (visualRoot != nullptr) { proxy = visualRoot->property("__qs_proxywindow").value(); if (proxy) break; visualRoot = visualRoot->parentItem(); }; if (!proxy) return nullptr; auto v = proxy->property("__qs_window_attached"); if (auto* attached = v.value()) { return attached; } auto* attached = new ProxyWindowAttached(proxy); if (attached) { proxy->setProperty("__qs_window_attached", QVariant::fromValue(attached)); } return attached; }