From 5f75c40b673064928ce5e081c85a5fe967e0da29 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 13 Feb 2024 00:58:47 -0800 Subject: [PATCH] feat: expose the backing window for ProxyWindowBase --- src/cpp/proxywindow.cpp | 1 + src/cpp/proxywindow.hpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/cpp/proxywindow.cpp b/src/cpp/proxywindow.cpp index 5177732d..dc4394be 100644 --- a/src/cpp/proxywindow.cpp +++ b/src/cpp/proxywindow.cpp @@ -42,6 +42,7 @@ QQuickWindow* ProxyWindowBase::disownWindow() { return window; } +QQuickWindow* ProxyWindowBase::backingWindow() { return this->window; } QQuickItem* ProxyWindowBase::item() { return this->window->contentItem(); } // NOLINTNEXTLINE diff --git a/src/cpp/proxywindow.hpp b/src/cpp/proxywindow.hpp index c62f3746..099bf2d5 100644 --- a/src/cpp/proxywindow.hpp +++ b/src/cpp/proxywindow.hpp @@ -20,6 +20,14 @@ // like anchors must use `item`. class ProxyWindowBase: public Scavenger { Q_OBJECT; + /// The QtQuick window backing this window. + /// + /// > [!WARNING] Do not expect values set via this property to work correctly. + /// > Values set this way will almost certainly misbehave across a reload, possibly + /// > even without one. + /// > + /// > Use **only** if you know what you are doing. + Q_PROPERTY(QQuickWindow* _backingWindow READ backingWindow); /// The content item of the window. Q_PROPERTY(QQuickItem* item READ item CONSTANT); /// The visibility of the window. @@ -63,6 +71,7 @@ public: // Disown the backing window and delete all its children. virtual QQuickWindow* disownWindow(); + QQuickWindow* backingWindow(); QQuickItem* item(); virtual bool isVisible();