From 7ee429dd7a12dc38a4e4af8888325d111883a2ff Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 12 Jun 2014 20:23:10 +0200 Subject: Introduce Flickable.OvershootBounds behavior Related to QTBUG-38515. It is not always desired to allow dragging over bounds even if flicking overshoots. This makes it possible to implement collision effects for flicks, while a drag over bounds would still do nothing. [ChangeLog][QtQuick][Flickable] Introduced Flickable.OvershootBounds behavior that allows content overshooting the boundary when flicked, but does not allow dragging content beyond the boundary of Flickable. [ChangeLog][QtQuick][Important Behavior Changes] Flickable.DragAndOvershootBounds value changed from 2 to 3. This will only affect you if you've worked around enum type checking and have the integer value explicitly in your code. Change-Id: I63c3540ab293a9c7c801d81220f74909d3fa1e17 Reviewed-by: Martin Jones --- src/quick/items/qquickflickable_p.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/quick/items/qquickflickable_p.h') diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h index c996d18b01..6b58584751 100644 --- a/src/quick/items/qquickflickable_p.h +++ b/src/quick/items/qquickflickable_p.h @@ -94,7 +94,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickFlickable : public QQuickItem Q_CLASSINFO("DefaultProperty", "flickableData") Q_ENUMS(FlickableDirection) - Q_ENUMS(BoundsBehavior) + Q_FLAGS(BoundsBehavior) public: QQuickFlickable(QQuickItem *parent=0); @@ -103,7 +103,14 @@ public: QQmlListProperty flickableData(); QQmlListProperty flickableChildren(); - enum BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds }; + enum BoundsBehaviorFlag { + StopAtBounds = 0x0, + DragOverBounds = 0x1, + OvershootBounds = 0x2, + DragAndOvershootBounds = DragOverBounds | OvershootBounds + }; + Q_DECLARE_FLAGS(BoundsBehavior, BoundsBehaviorFlag) + BoundsBehavior boundsBehavior() const; void setBoundsBehavior(BoundsBehavior); -- cgit v1.2.3