diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-05-20 15:23:05 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-05-23 14:17:19 +0000 |
commit | 93cd723a4a6f479909f9ad89f67b0537874f626f (patch) | |
tree | 1e8a61c52c3c5512d00803dae3bb04b58a86bd60 /src/quicktemplates2/qquickoverlay_p.h | |
parent | 0bd08232c5034aec06d5c6554a74c84cb79e53f6 (diff) |
Make Overlay.modal and modeless Components
This way we can simply instantiate a visual overlay for each modal or
dimming popup without having tricky problems with overlay's stacking
order. It makes also sense to not instantiate the overlays for hidden
popups.
Coincidentally, this change also fixes a problem that the overlay
turned out to be _always_ visible since a hidden overlay background
was always instantiated no matter if there were open popups, or
popups at all.
Change-Id: Ieb64a72c827d0a005418027428378ebe04f41117
Task-number: QTBUG-53519
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickoverlay_p.h')
-rw-r--r-- | src/quicktemplates2/qquickoverlay_p.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/quicktemplates2/qquickoverlay_p.h b/src/quicktemplates2/qquickoverlay_p.h index 77137257..99d7ba75 100644 --- a/src/quicktemplates2/qquickoverlay_p.h +++ b/src/quicktemplates2/qquickoverlay_p.h @@ -53,22 +53,23 @@ QT_BEGIN_NAMESPACE +class QQmlComponent; class QQuickOverlayPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickOverlay : public QQuickItem { Q_OBJECT - Q_PROPERTY(QQuickItem *modal READ modal WRITE setModal NOTIFY modalChanged FINAL) - Q_PROPERTY(QQuickItem *modeless READ modeless WRITE setModeless NOTIFY modelessChanged FINAL) + Q_PROPERTY(QQmlComponent *modal READ modal WRITE setModal NOTIFY modalChanged FINAL) + Q_PROPERTY(QQmlComponent *modeless READ modeless WRITE setModeless NOTIFY modelessChanged FINAL) public: explicit QQuickOverlay(QQuickItem *parent = nullptr); - QQuickItem *modal() const; - void setModal(QQuickItem *modal); + QQmlComponent *modal() const; + void setModal(QQmlComponent *modal); - QQuickItem *modeless() const; - void setModeless(QQuickItem *modeless); + QQmlComponent *modeless() const; + void setModeless(QQmlComponent *modeless); Q_SIGNALS: void modalChanged(); |