diff options
Diffstat (limited to 'src/quicktemplates2/qquickswipedelegate_p.h')
-rw-r--r-- | src/quicktemplates2/qquickswipedelegate_p.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate_p.h b/src/quicktemplates2/qquickswipedelegate_p.h index 2e1c515d..16aa9837 100644 --- a/src/quicktemplates2/qquickswipedelegate_p.h +++ b/src/quicktemplates2/qquickswipedelegate_p.h @@ -52,8 +52,10 @@ QT_BEGIN_NAMESPACE -class QQuickSwipeDelegatePrivate; class QQuickSwipe; +class QQuickSwipeDelegatePrivate; +class QQuickSwipeDelegateAttached; +class QQuickSwipeDelegateAttachedPrivate; class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwipeDelegate : public QQuickItemDelegate { @@ -65,6 +67,8 @@ public: QQuickSwipe *swipe() const; + static QQuickSwipeDelegateAttached *qmlAttachedProperties(QObject *object); + protected: bool childMouseEventFilter(QQuickItem *child, QEvent *event) override; void mousePressEvent(QMouseEvent *event) override; @@ -84,8 +88,29 @@ private: Q_DECLARE_PRIVATE(QQuickSwipeDelegate) }; +class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwipeDelegateAttached : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool pressed READ isPressed NOTIFY pressedChanged FINAL) + +public: + explicit QQuickSwipeDelegateAttached(QObject *object = nullptr); + + bool isPressed() const; + void setPressed(bool pressed); + +Q_SIGNALS: + void pressedChanged(); + void clicked(); + +private: + Q_DISABLE_COPY(QQuickSwipeDelegateAttached) + Q_DECLARE_PRIVATE(QQuickSwipeDelegateAttached) +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickSwipeDelegate) +QML_DECLARE_TYPEINFO(QQuickSwipeDelegate, QML_HAS_ATTACHED_PROPERTIES) #endif // QQUICKSWIPEDELEGATE_P_H |