diff --git a/src/window/proxywindow.cpp b/src/window/proxywindow.cpp index df9b6b3d..81f43344 100644 --- a/src/window/proxywindow.cpp +++ b/src/window/proxywindow.cpp @@ -542,7 +542,8 @@ void ProxyWindowAttached::updateWindow() { void ProxyWindowAttached::setWindow(ProxyWindowBase* window) { if (window == this->mWindow) return; this->mWindow = window; - this->mWindowInterface = window ? qobject_cast(window->parent()) : nullptr; + auto* parentInterface = window ? qobject_cast(window->parent()) : nullptr; + this->mWindowInterface = parentInterface ? static_cast(parentInterface) : window; emit this->windowChanged(); } diff --git a/src/window/proxywindow.hpp b/src/window/proxywindow.hpp index 42039414..1d075166 100644 --- a/src/window/proxywindow.hpp +++ b/src/window/proxywindow.hpp @@ -220,7 +220,7 @@ protected: private: ProxyWindowBase* mWindow = nullptr; - WindowInterface* mWindowInterface = nullptr; + QObject* mWindowInterface = nullptr; void setWindow(ProxyWindowBase* window); };