@@ -19,6 +19,10 @@ class ProxyFloatingWindow: public ProxyWindowBase {
1919 explicit ProxyFloatingWindow (QObject* parent = nullptr ): ProxyWindowBase(parent) {}
2020
2121 void connectWindow () override ;
22+ void postCompleteWindow () override ;
23+
24+ [[nodiscard]] QObject* parentWindow () const ;
25+ void setParentWindow (QObject* window);
2226
2327 // Setting geometry while the window is visible makes the content item shrink but not the window
2428 // which is awful so we disable it for floating windows.
@@ -35,6 +39,9 @@ class ProxyFloatingWindow: public ProxyWindowBase {
3539 void onMaximumSizeChanged ();
3640 void onTitleChanged ();
3741
42+ QObject* mParentWindow = nullptr ;
43+ ProxyWindowBase* mParentProxyWindow = nullptr ;
44+
3845public:
3946 Q_OBJECT_BINDABLE_PROPERTY (
4047 ProxyFloatingWindow,
@@ -75,6 +82,11 @@ class FloatingWindowInterface: public WindowInterface {
7582 Q_PROPERTY (bool maximized READ isMaximized WRITE setMaximized NOTIFY maximizedChanged);
7683 // / Whether the window is currently fullscreen.
7784 Q_PROPERTY (bool fullscreen READ isFullscreen WRITE setFullscreen NOTIFY fullscreenChanged);
85+ // / The parent window of this window. Setting this makes the window a child of the parent,
86+ // / which affects window stacking behavior.
87+ // /
88+ // / > [!NOTE] This property cannot be changed after the window is visible.
89+ Q_PROPERTY (QObject* parentWindow READ parentWindow WRITE setParentWindow);
7890 // clang-format on
7991 QML_NAMED_ELEMENT (FloatingWindow);
8092
@@ -101,6 +113,9 @@ class FloatingWindowInterface: public WindowInterface {
101113 // / Start a system resize operation. Must be called during a pointer press/drag.
102114 Q_INVOKABLE [[nodiscard]] bool startSystemResize (Qt::Edges edges) const ;
103115
116+ [[nodiscard]] QObject* parentWindow () const ;
117+ void setParentWindow (QObject* window);
118+
104119signals:
105120 void minimumSizeChanged ();
106121 void maximumSizeChanged ();
0 commit comments