summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeflickable.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-02-14 08:29:21 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-02-14 08:29:21 (GMT)
commit8fb224b87b4508d259f8348920caadc6a75c45e2 (patch)
tree76a9642f5c92e299c9c41031c52bd86730b6037f /src/declarative/graphicsitems/qdeclarativeflickable.cpp
parentf1021208218aa1d7eda58fed2742ea6a99266153 (diff)
parent3bc6f8d8dd630cd0298e27fc4b7430d2bf73a232 (diff)
downloadQt-8fb224b87b4508d259f8348920caadc6a75c45e2.zip
Qt-8fb224b87b4508d259f8348920caadc6a75c45e2.tar.gz
Qt-8fb224b87b4508d259f8348920caadc6a75c45e2.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Don't leak ScopeChainNode's Rename 'plugins\qmldebugging' (work around qmake issues) Correct the "module not installed" error handling Flickable uses the flick velocity to determine whether to retain grab Make addImportPath() work for windows paths starting with lower case Report any exceptions occurring in WorkerScript javascript code MouseArea docs - link to onCanceled() from onReleased()
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeflickable.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index a12a5ed..8b2d094 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -53,6 +53,10 @@ QT_BEGIN_NAMESPACE
// before we perform a flick.
static const int FlickThreshold = 20;
+// RetainGrabVelocity is the maxmimum instantaneous velocity that
+// will ensure the Flickable retains the grab on consecutive flicks.
+static const int RetainGrabVelocity = 15;
+
QDeclarativeFlickableVisibleArea::QDeclarativeFlickableVisibleArea(QDeclarativeFlickable *parent)
: QObject(parent), flickable(parent), m_xPosition(0.), m_widthRatio(0.)
, m_yPosition(0.), m_heightRatio(0.)
@@ -672,7 +676,8 @@ void QDeclarativeFlickable::setFlickableDirection(FlickableDirection direction)
void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_Q(QDeclarativeFlickable);
- if (interactive && timeline.isActive() && (qAbs(hData.velocity) > 10 || qAbs(vData.velocity) > 10))
+ if (interactive && timeline.isActive()
+ && (qAbs(hData.smoothVelocity.value()) > RetainGrabVelocity || qAbs(vData.smoothVelocity.value()) > RetainGrabVelocity))
stealMouse = true; // If we've been flicked then steal the click.
else
stealMouse = false;