diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-08-01 15:49:33 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-02 06:42:28 +0200 |
commit | ec55d20563254f946135666412e2bdf8f8184e77 (patch) | |
tree | cc82bcb61dbf474c35c19e5be27368502bb35874 /src/declarative/items/qsgpathview.cpp | |
parent | a1bd1690851c905d79ae694c15a04fd12a717f3e (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/declarative/items/qsgpathview.cpp')
-rw-r--r-- | src/declarative/items/qsgpathview.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/declarative/items/qsgpathview.cpp b/src/declarative/items/qsgpathview.cpp index e10575cf7b..9fae40fc04 100644 --- a/src/declarative/items/qsgpathview.cpp +++ b/src/declarative/items/qsgpathview.cpp @@ -976,6 +976,7 @@ bool QSGPathView::sendMouseEvent(QGraphicsSceneMouseEvent *event) return d->stealMouse; } else if (d->lastPosTime.isValid()) { d->lastPosTime.invalidate(); + d->fixOffset(); } if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) d->stealMouse = false; @@ -1000,6 +1001,18 @@ bool QSGPathView::childMouseEventFilter(QSGItem *i, QEvent *e) return QSGItem::childMouseEventFilter(i, e); } +void QSGPathView::mouseUngrabEvent() +{ + Q_D(QSGPathView); + if (d->stealMouse) { + // if our mouse grab has been removed (probably by a Flickable), + // fix our state + d->stealMouse = false; + setKeepMouseGrab(false); + d->lastPosTime.invalidate(); + } +} + void QSGPathView::updatePolish() { QSGItem::updatePolish(); |