@@ -18,6 +18,10 @@ class ProxyFloatingWindow: public ProxyWindowBase {
1818 explicit ProxyFloatingWindow (QObject* parent = nullptr ): ProxyWindowBase(parent) {}
1919
2020 void connectWindow () override ;
21+ void postCompleteWindow () override ;
22+
23+ [[nodiscard]] QObject* parentWindow () const ;
24+ void setParentWindow (QObject* window);
2125
2226 // Setting geometry while the window is visible makes the content item shrink but not the window
2327 // which is awful so we disable it for floating windows.
@@ -34,6 +38,9 @@ class ProxyFloatingWindow: public ProxyWindowBase {
3438 void onMaximumSizeChanged ();
3539 void onTitleChanged ();
3640
41+ QObject* mParentWindow = nullptr ;
42+ ProxyWindowBase* mParentProxyWindow = nullptr ;
43+
3744public:
3845 Q_OBJECT_BINDABLE_PROPERTY (
3946 ProxyFloatingWindow,
@@ -68,6 +75,11 @@ class FloatingWindowInterface: public WindowInterface {
6875 Q_PROPERTY (QSize minimumSize READ default WRITE default NOTIFY minimumSizeChanged BINDABLE bindableMinimumSize);
6976 // / Maximum window size given to the window system.
7077 Q_PROPERTY (QSize maximumSize READ default WRITE default NOTIFY maximumSizeChanged BINDABLE bindableMaximumSize);
78+ // / The parent window of this window. Setting this makes the window a child of the parent,
79+ // / which affects window stacking behavior.
80+ // /
81+ // / > [!NOTE] This property cannot be changed after the window is visible.
82+ Q_PROPERTY (QObject* parentWindow READ parentWindow WRITE setParentWindow);
7183 // clang-format on
7284 QML_NAMED_ELEMENT (FloatingWindow);
7385
@@ -82,6 +94,9 @@ class FloatingWindowInterface: public WindowInterface {
8294 QBindable<QSize> bindableMaximumSize () { return &this ->window ->bMaximumSize ; }
8395 QBindable<QString> bindableTitle () { return &this ->window ->bTitle ; }
8496
97+ [[nodiscard]] QObject* parentWindow () const ;
98+ void setParentWindow (QObject* window);
99+
85100signals:
86101 void minimumSizeChanged ();
87102 void maximumSizeChanged ();
0 commit comments