summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-09-13 14:23:17 -0700
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-09-23 16:43:37 +0300
commit8f965b2c25f0fe1a5be4bc054c174656a09f03a4 (patch)
tree95e14d0ad85c4c2559fca528010caf71e625618e
parent746bb678c8a16919adae94ac4cd1ccc8433c1b8c (diff)
downloadqtlocation-mapboxgl-8f965b2c25f0fe1a5be4bc054c174656a09f03a4.tar.gz
[Qt] Add map pitch support on the example app
-rw-r--r--platform/qt/app/mapwindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp
index e8319365b7..55ab05cc01 100644
--- a/platform/qt/app/mapwindow.cpp
+++ b/platform/qt/app/mapwindow.cpp
@@ -160,7 +160,9 @@ void MapWindow::mouseMoveEvent(QMouseEvent *ev)
#endif
if (!delta.isNull()) {
- if (ev->buttons() == Qt::LeftButton) {
+ if (ev->buttons() == Qt::LeftButton && ev->modifiers() & Qt::ShiftModifier) {
+ m_map.setPitch(m_map.pitch() - delta.y());
+ } else if (ev->buttons() == Qt::LeftButton) {
m_map.moveBy(delta);
} else if (ev->buttons() == Qt::RightButton) {
#if QT_VERSION < 0x050000