summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-09-09 18:31:28 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-09-11 10:47:25 +0000
commitdcc9ec9e9ab3eaada5c68896833c14f905084922 (patch)
treef66d60f88f92b2212ca1b9789b42b9f4c8029123 /src
parent361a08dca7af6ebe159f217a9bb3c6c4a29126eb (diff)
downloadqtlocation-dcc9ec9e9ab3eaada5c68896833c14f905084922.tar.gz
Fix MapGestureArea not emitting when controlled with scroll wheel
Rotation and tilt signals are currently not emitted. This patch emits all of them for each scroll wheel event. Change-Id: Ia1aaec0e757a5c70d5308d5a8b6f12d48c5d751e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/location/declarativemaps/qquickgeomapgesturearea.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
index fc2debc3..ac2887a5 100644
--- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp
+++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
@@ -943,14 +943,20 @@ void QQuickGeoMapGestureArea::handleWheelEvent(QWheelEvent *event)
// Not using AltModifier as, for some reason, it causes angleDelta to be 0
if (event->modifiers() & Qt::ShiftModifier && rotationEnabled()) {
+ emit rotationStarted(&m_pinch.m_event);
// First set bearing
const double bearingDelta = event->angleDelta().y() * qreal(0.05);
m_declarativeMap->setBearing(m_declarativeMap->bearing() + bearingDelta);
// then reanchor
m_declarativeMap->setCenter(m_map->geoProjection().anchorCoordinateToPoint(wheelGeoPos, preZoomPoint));
+ emit rotationUpdated(&m_pinch.m_event);
+ emit rotationFinished(&m_pinch.m_event);
} else if (event->modifiers() & Qt::ControlModifier && tiltEnabled()) {
+ emit tiltStarted(&m_pinch.m_event);
const double tiltDelta = event->angleDelta().y() * qreal(0.05);
m_declarativeMap->setTilt(m_declarativeMap->tilt() + tiltDelta);
+ emit tiltUpdated(&m_pinch.m_event);
+ emit tiltFinished(&m_pinch.m_event);
} else if (pinchEnabled()) {
const double zoomLevelDelta = event->angleDelta().y() * qreal(0.001);
// Gesture area should always honor maxZL, but Map might not.