diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-01 14:44:53 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-26 15:35:25 +0000 |
commit | d0fdebbc378f2d5c1993eee56b63e27bcff04ca5 (patch) | |
tree | 848f544ac0b1575751c679f2860f6b345003f398 /src/quicktemplates2/qquickoverlay_p.h | |
parent | 5dfa85e68c6a9fc3fbedb47737dd34c843e2ba2b (diff) |
Add Overlay attached properties and signals
[ChangeLog][Controls][ApplicationWindow] Deprecated the overlay grouped
property in favor of the newly introduced Overlay attached properties.
[ChangeLog][Controls][Overlay] Introduced Overlay attached properties
and signals that supersede the overlay grouped property in Application
Window. The Overlay attached type allows providing background dimming
for popups without requiring an ApplicationWindow instance.
Task-number: QTBUG-61336
Change-Id: I9df11bcb167e7725014d5f058fe24d70da4a10b3
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickoverlay_p.h')
-rw-r--r-- | src/quicktemplates2/qquickoverlay_p.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickoverlay_p.h b/src/quicktemplates2/qquickoverlay_p.h index ba61c9c9..0d8bccf5 100644 --- a/src/quicktemplates2/qquickoverlay_p.h +++ b/src/quicktemplates2/qquickoverlay_p.h @@ -55,6 +55,8 @@ QT_BEGIN_NAMESPACE class QQmlComponent; class QQuickOverlayPrivate; +class QQuickOverlayAttached; +class QQuickOverlayAttachedPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickOverlay : public QQuickItem { @@ -74,6 +76,8 @@ public: static QQuickOverlay *overlay(QQuickWindow *window); + static QQuickOverlayAttached *qmlAttachedProperties(QObject *object); + Q_SIGNALS: void modalChanged(); void modelessChanged(); @@ -101,8 +105,39 @@ private: Q_DECLARE_PRIVATE(QQuickOverlay) }; +class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickOverlayAttached : public QObject +{ + Q_OBJECT + Q_PROPERTY(QQuickOverlay *overlay READ overlay NOTIFY overlayChanged 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 QQuickOverlayAttached(QObject *parent = nullptr); + + QQuickOverlay *overlay() const; + + QQmlComponent *modal() const; + void setModal(QQmlComponent *modal); + + QQmlComponent *modeless() const; + void setModeless(QQmlComponent *modeless); + +Q_SIGNALS: + void overlayChanged(); + void modalChanged(); + void modelessChanged(); + void pressed(); + void released(); + +private: + Q_DISABLE_COPY(QQuickOverlayAttached) + Q_DECLARE_PRIVATE(QQuickOverlayAttached) +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickOverlay) +QML_DECLARE_TYPEINFO(QQuickOverlay, QML_HAS_ATTACHED_PROPERTIES) #endif // QQUICKOVERLAY_P_H |