diff --git a/src/declarativeimports/core/dialog.cpp b/src/declarativeimports/core/dialog.cpp index c5440b7eb..d4a45f05c 100644 --- a/src/declarativeimports/core/dialog.cpp +++ b/src/declarativeimports/core/dialog.cpp @@ -679,6 +679,16 @@ void DialogProxy::updateInputShape() #endif } +void DialogProxy::setTransientParentAndNotify(QWindow *parent) +{ + if (parent == transientParent()) { + return; + } + + setTransientParent(parent); + emit transientParentChanged(); +} + //find the screen which contains the item QScreen* DialogProxy::screenForItem(QQuickItem* item) const diff --git a/src/declarativeimports/core/dialog.h b/src/declarativeimports/core/dialog.h index 21607a13a..49b2cc18c 100644 --- a/src/declarativeimports/core/dialog.h +++ b/src/declarativeimports/core/dialog.h @@ -76,6 +76,11 @@ class DialogProxy : public QQuickWindow, public QQmlParserStatus */ Q_PROPERTY(WindowType type READ type WRITE setType NOTIFY typeChanged) + /** + * This is a hint to the window manager that this window is a dialog or pop-up on behalf of the given window. + */ + Q_PROPERTY(QWindow *transientParent READ transientParent WRITE setTransientParentAndNotify NOTIFY transientParentChanged) + /** * Whether the dialog should be hidden when the dialog loses focus. * @@ -141,6 +146,8 @@ public: bool isOutputOnly() const; void updateInputShape(); + void setTransientParentAndNotify(QWindow *parent); + Q_SIGNALS: void mainItemChanged(); void locationChanged(); @@ -148,6 +155,7 @@ Q_SIGNALS: void typeChanged(); void hideOnWindowDeactivateChanged(); void outputOnlyChanged(); + void transientParentChanged(); public Q_SLOTS: void syncMainItemToSize();