aboutsummaryrefslogtreecommitdiffstats
path: root/src/qtquick1/graphicsitems/qdeclarativepathview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-08-01 15:49:33 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-02 06:42:28 +0200
commitec55d20563254f946135666412e2bdf8f8184e77 (patch)
treecc82bcb61dbf474c35c19e5be27368502bb35874 /src/qtquick1/graphicsitems/qdeclarativepathview.cpp
parenta1bd1690851c905d79ae694c15a04fd12a717f3e (diff)
Nesting PathView and Flickable causes PathView to stop at wrong offset
Don't stop current animation until a drag is actually initiated. Also ensure we handle a stolen grab sensibly. Change-Id: I0ad493595fb85e1c9bace2d805184f911341fce2 Fixes: QTBUG-19439 Reviewed-on: http://codereview.qt.nokia.com/2420 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qtquick1/graphicsitems/qdeclarativepathview.cpp')
-rw-r--r--src/qtquick1/graphicsitems/qdeclarativepathview.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/qtquick1/graphicsitems/qdeclarativepathview.cpp b/src/qtquick1/graphicsitems/qdeclarativepathview.cpp
index 2c0875b4c4..d3284c799d 100644
--- a/src/qtquick1/graphicsitems/qdeclarativepathview.cpp
+++ b/src/qtquick1/graphicsitems/qdeclarativepathview.cpp
@@ -1285,6 +1285,7 @@ bool QDeclarative1PathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
return d->stealMouse;
} else if (d->lastPosTime.isValid()) {
d->lastPosTime.invalidate();
+ d->fixOffset();
}
if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease)
d->stealMouse = false;
@@ -1309,6 +1310,22 @@ bool QDeclarative1PathView::sceneEventFilter(QGraphicsItem *i, QEvent *e)
return QDeclarativeItem::sceneEventFilter(i, e);
}
+bool QDeclarative1PathView::sceneEvent(QEvent *event)
+{
+ bool rv = QDeclarativeItem::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ Q_D(QDeclarative1PathView);
+ if (d->stealMouse) {
+ // if our mouse grab has been removed (probably by another Flickable),
+ // fix our state
+ d->stealMouse = false;
+ setKeepMouseGrab(false);
+ d->lastPosTime.invalidate();
+ }
+ }
+ return rv;
+}
+
bool QDeclarative1PathView::event(QEvent *event)
{
if (event->type() == QEvent::User) {