From 60686a20c7bb669d16d99a16ca8a8f96695f1684 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 26 Feb 2013 13:30:31 +0100 Subject: define MODULE_VERSION Task-number: QTBUG-29838 Change-Id: I0dd628cdf63c13a8ac94213f2fc1b7d04df24786 Reviewed-by: Thiago Macieira --- .qmake.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.qmake.conf b/.qmake.conf index 5de255cb..02554aba 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,2 +1,4 @@ load(qt_build_config) CONFIG += qt_example_installs + +MODULE_VERSION = 5.0.2 -- cgit v1.2.3 From 3a80424aeae19e838be03aa12a5243911ec3f020 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Tue, 12 Mar 2013 16:04:54 +1000 Subject: Fix jump and property changes on first move when dragging a Flickable. Fixes a regression whereby on the first mouse move the contentItem was moved the total distance from the touch point to where the drag distance was exceeded. For large drag thresholds this causes a noticeable jump. Task-number: QTBUG-30032 Change-Id: I92c119d27dc2e22203484f9ada5978697d171957 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 8 ++++---- .../qdeclarativeflickable/tst_qdeclarativeflickable.cpp | 6 ++++++ .../qdeclarativemousearea/tst_qdeclarativemousearea.cpp | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index c0c7b2a0..64ae2094 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -789,9 +789,9 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (q->yflick()) { int dy = int(event->pos().y() - pressPos.y()); - if (vData.dragStartOffset == 0) - vData.dragStartOffset = dy; if (qAbs(dy) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) { + if (!vMoved) + vData.dragStartOffset = dy; qreal newY = dy + vData.pressPos - vData.dragStartOffset; const qreal minY = vData.dragMinBound; const qreal maxY = vData.dragMaxBound; @@ -818,9 +818,9 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (q->xflick()) { int dx = int(event->pos().x() - pressPos.x()); - if (hData.dragStartOffset == 0) - hData.dragStartOffset = dx; if (qAbs(dx) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) { + if (!hMoved) + hData.dragStartOffset = dx; qreal newX = dx + hData.pressPos - hData.dragStartOffset; const qreal minX = hData.dragMinBound; const qreal maxX = hData.dragMaxBound; diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp index b0fa7bd6..c8a98d33 100644 --- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp +++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp @@ -576,6 +576,9 @@ void tst_qdeclarativeflickable::nestedStopAtBounds() axis += invert ? threshold : -threshold; moveEvent.setScenePos(position); QApplication::sendEvent(view.scene(), &moveEvent); + axis += invert ? threshold : -threshold; + moveEvent.setScenePos(position); + QApplication::sendEvent(view.scene(), &moveEvent); QVERIFY(outer->contentX() != 50 || outer->contentY() != 50); QVERIFY((inner->contentX() == 0 || inner->contentX() == 100) && (inner->contentY() == 0 || inner->contentY() == 100)); @@ -594,6 +597,9 @@ void tst_qdeclarativeflickable::nestedStopAtBounds() axis += invert ? -threshold : threshold; moveEvent.setScenePos(position); QApplication::sendEvent(view.scene(), &moveEvent); + axis += invert ? -threshold : threshold; + moveEvent.setScenePos(position); + QApplication::sendEvent(view.scene(), &moveEvent); QVERIFY(outer->contentX() == 50 && outer->contentY() == 50); QVERIFY((inner->contentX() != 0 && inner->contentX() != 100) || (inner->contentY() != 0 && inner->contentY() != 100)); diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index 37e64d4d..855ad602 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -597,8 +597,8 @@ void tst_QDeclarativeMouseArea::preventStealing() QVERIFY(!mouseArea->pressed()); // Flickable content should have moved. - QCOMPARE(flickable->contentX(), 30.); - QCOMPARE(flickable->contentY(), 30.); + QCOMPARE(flickable->contentX(), 15.); + QCOMPARE(flickable->contentY(), 15.); QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50))); -- cgit v1.2.3 From b35d793648a24b229aac75ea43d5a175967304ca Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 14 Mar 2013 13:27:35 +1000 Subject: Smooth dragging an item with MouseArea. Calculate drag distance relative to the mouse position when a drag is detected rather than the press position so there isn't a large change in position on the first move. Task-number: QTBUG-30188 Change-Id: I46918a7b3c62bdaef567b6a9fed651ce33434247 Reviewed-by: Martin Jones --- .../graphicsitems/qdeclarativemousearea.cpp | 1 + .../tst_qdeclarativemousearea.cpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 9fa325b0..4752ec32 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -558,6 +558,7 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) if (qAbs(x - d->startX) > dragThreshold || qAbs(y - d->startY) > dragThreshold) { setKeepMouseGrab(true); d->stealMouse = true; + d->startScene = event->scenePos(); } } diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index 855ad602..0415c5c9 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -239,18 +239,18 @@ void tst_QDeclarativeMouseArea::dragging() QApplication::sendEvent(scene, &moveEvent); QVERIFY(drag->active()); - QCOMPARE(blackRect->x(), 72.0); - QCOMPARE(blackRect->y(), 72.0); + QCOMPARE(blackRect->x(), 61.0); + QCOMPARE(blackRect->y(), 61.0); QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); - releaseEvent.setScenePos(QPointF(110, 110)); + releaseEvent.setScenePos(QPointF(122, 122)); releaseEvent.setButton(Qt::LeftButton); releaseEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &releaseEvent); QVERIFY(!drag->active()); - QCOMPARE(blackRect->x(), 72.0); - QCOMPARE(blackRect->y(), 72.0); + QCOMPARE(blackRect->x(), 61.0); + QCOMPARE(blackRect->y(), 61.0); delete canvas; } @@ -741,14 +741,14 @@ void tst_QDeclarativeMouseArea::changeAxis() QApplication::sendEvent(scene, &moveEvent); QVERIFY(drag->active()); - QCOMPARE(blackRect->x(), 72.0); - QCOMPARE(blackRect->y(), 72.0); + QCOMPARE(blackRect->x(), 61.0); + QCOMPARE(blackRect->y(), 61.0); QCOMPARE(drag->axis(), QDeclarativeDrag::XandYAxis); /* When blackRect.x becomes bigger than 75, the drag axis is change to * Drag.YAxis by the QML code. Verify that this happens, and that the drag * movement is effectively constrained to the Y axis. */ - moveEvent.setScenePos(QPointF(133, 133)); + moveEvent.setScenePos(QPointF(144, 144)); moveEvent.setButton(Qt::LeftButton); moveEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &moveEvent); @@ -757,7 +757,7 @@ void tst_QDeclarativeMouseArea::changeAxis() QCOMPARE(blackRect->y(), 83.0); QCOMPARE(drag->axis(), QDeclarativeDrag::YAxis); - moveEvent.setScenePos(QPointF(144, 144)); + moveEvent.setScenePos(QPointF(155, 155)); moveEvent.setButton(Qt::LeftButton); moveEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &moveEvent); @@ -766,7 +766,7 @@ void tst_QDeclarativeMouseArea::changeAxis() QCOMPARE(blackRect->y(), 94.0); QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); - releaseEvent.setScenePos(QPointF(144, 144)); + releaseEvent.setScenePos(QPointF(155, 155)); releaseEvent.setButton(Qt::LeftButton); releaseEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &releaseEvent); -- cgit v1.2.3 From 1bb72578a34851d24e173c703a2186b1729b00e5 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 25 Mar 2013 11:13:59 +0100 Subject: Bump MODULE_VERSION to 5.1.0 Change-Id: I5362a735a0982eedad071a307e1a423eaee57041 Reviewed-by: Oswald Buddenhagen --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 02554aba..6aa780ca 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,4 +1,4 @@ load(qt_build_config) CONFIG += qt_example_installs -MODULE_VERSION = 5.0.2 +MODULE_VERSION = 5.1.0 -- cgit v1.2.3