aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickswipedelegate_p.h
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-10-04 11:21:46 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-11-23 10:48:32 +0000
commit9812a9cc1e71b0a3d8f25c0db2457f8673e53054 (patch)
tree0a7df0e367508a64728d5994b7500c7f3f08ad06 /src/quicktemplates2/qquickswipedelegate_p.h
parent2202d79b39ff90eed19fb8106f79d4604e47acfd (diff)
SwipeDelegate: don't emit clicked when released outside
If there are no delegates and hence the mouse hasn't been grabbed, we should clear the pressed state when the mouse is dragged outside the control. We can do so by falling back to the event handling of the base class (QQuickItemDelegate) when we have no delegates. This also ensures that the canceled() signal is emitted. A similar thing is done for controls with delegates, except that only the vertical position of the mouse is checked, as we still want to initiate swipes horizontally. Change-Id: I7738f5b9e8e8b6ce4a733008fa4ff73596e854ea Task-number: QTBUG-56312 Task-number: QTBUG-57285 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickswipedelegate_p.h')
-rw-r--r--src/quicktemplates2/qquickswipedelegate_p.h56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate_p.h b/src/quicktemplates2/qquickswipedelegate_p.h
index e71455b0..2e1c515d 100644
--- a/src/quicktemplates2/qquickswipedelegate_p.h
+++ b/src/quicktemplates2/qquickswipedelegate_p.h
@@ -84,62 +84,6 @@ private:
Q_DECLARE_PRIVATE(QQuickSwipeDelegate)
};
-class QQuickSwipePrivate;
-
-class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickSwipe : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(qreal position READ position NOTIFY positionChanged FINAL)
- Q_PROPERTY(bool complete READ isComplete NOTIFY completeChanged FINAL)
- Q_PROPERTY(QQmlComponent *left READ left WRITE setLeft NOTIFY leftChanged FINAL)
- Q_PROPERTY(QQmlComponent *behind READ behind WRITE setBehind NOTIFY behindChanged FINAL)
- Q_PROPERTY(QQmlComponent *right READ right WRITE setRight NOTIFY rightChanged FINAL)
- Q_PROPERTY(QQuickItem *leftItem READ leftItem NOTIFY leftItemChanged FINAL)
- Q_PROPERTY(QQuickItem *behindItem READ behindItem NOTIFY behindItemChanged FINAL)
- Q_PROPERTY(QQuickItem *rightItem READ rightItem NOTIFY rightItemChanged FINAL)
-
-public:
- explicit QQuickSwipe(QQuickSwipeDelegate *control);
-
- qreal position() const;
- void setPosition(qreal position);
-
- bool isComplete() const;
- void setComplete(bool complete);
-
- QQmlComponent *left() const;
- void setLeft(QQmlComponent *left);
-
- QQmlComponent *behind() const;
- void setBehind(QQmlComponent *behind);
-
- QQmlComponent *right() const;
- void setRight(QQmlComponent *right);
-
- QQuickItem *leftItem() const;
- void setLeftItem(QQuickItem *item);
-
- QQuickItem *behindItem() const;
- void setBehindItem(QQuickItem *item);
-
- QQuickItem *rightItem() const;
- void setRightItem(QQuickItem *item);
-
-Q_SIGNALS:
- void positionChanged();
- void completeChanged();
- void leftChanged();
- void behindChanged();
- void rightChanged();
- void leftItemChanged();
- void behindItemChanged();
- void rightItemChanged();
-
-private:
- Q_DISABLE_COPY(QQuickSwipe)
- Q_DECLARE_PRIVATE(QQuickSwipe)
-};
-
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickSwipeDelegate)