From ee700d2eeb4508aa5356ddef11bf11964c5d9283 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 19 Oct 2018 09:24:36 +0200 Subject: Mapbox: Only include matching categories in the results If an entry in the results had no categories specified at all then it would end up including this in the results even if a specific category was requested to match against. Change-Id: I506b40b73ec07608bd2b2562d92065376fbb67c9 Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp b/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp index a79af1cb..b2f2f043 100644 --- a/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp +++ b/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp @@ -188,19 +188,18 @@ void QPlaceSearchReplyMapbox::onReplyFinished() if (!categories.isEmpty()) { const QList placeCategories = placeResult.place().categories(); + bool categoryMatch = false; if (!placeCategories.isEmpty()) { - bool categoryMatch = false; for (const QPlaceCategory &placeCategory : placeCategories) { if (categories.contains(placeCategory)) { categoryMatch = true; break; } } - if (!categoryMatch) - continue; } + if (!categoryMatch) + continue; } - placeResult.setDistance(searchCenter.distanceTo(placeResult.place().location().coordinate())); results.append(placeResult); } -- cgit v1.2.1 From 85df79b094d1097108a28424d6f9b3b76b3aee62 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Thu, 8 Nov 2018 15:26:57 +0900 Subject: Fix unstable rotation gesture Order of touch events are not sorted on some platform. When touch point 1 and 2 are swapped, map is rotated 180 degrees in a moment Change-Id: I9c308b805a6ca54519f26a9ff19217de7f947c17 Reviewed-by: Paolo Angelelli --- src/location/declarativemaps/qquickgeomapgesturearea.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp index c6f4b42f..576aeeea 100644 --- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp +++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp @@ -1087,6 +1087,7 @@ void QQuickGeoMapGestureArea::update() m_allPoints << m_touchPoints; if (m_allPoints.isEmpty() && !m_mousePoint.isNull()) m_allPoints << *m_mousePoint.data(); + std::sort(m_allPoints.begin(), m_allPoints.end(), [](const QTouchEvent::TouchPoint &tp1, const QTouchEvent::TouchPoint &tp2) { return tp1.id() < tp2.id(); }); touchPointStateMachine(); -- cgit v1.2.1 From d9985cd5a308cece06a88e6203529837f00b33aa Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Wed, 3 Oct 2018 12:56:18 +0200 Subject: Fix missing geometry update when changing border width In this case, only border geometry was marked dirty, producing a misplaced polygon. Fixes: QTBUG-70886 Change-Id: Ied39e523a584976871a655e436daf8c2700458b6 Reviewed-by: Alex Blasche --- src/location/declarativemaps/qdeclarativepolygonmapitem.cpp | 13 ++----------- src/location/declarativemaps/qdeclarativepolygonmapitem_p.h | 1 - 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp index c0d7f24b..e9f91e45 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp @@ -320,18 +320,9 @@ QDeclarativePolygonMapItem::QDeclarativePolygonMapItem(QQuickItem *parent) { setFlag(ItemHasContents, true); QObject::connect(&border_, SIGNAL(colorChanged(QColor)), - this, SLOT(handleBorderUpdated())); + this, SLOT(markSourceDirtyAndUpdate())); QObject::connect(&border_, SIGNAL(widthChanged(qreal)), - this, SLOT(handleBorderUpdated())); -} - -/*! - \internal -*/ -void QDeclarativePolygonMapItem::handleBorderUpdated() -{ - borderGeometry_.markSourceDirty(); - polishAndUpdate(); + this, SLOT(markSourceDirtyAndUpdate())); } QDeclarativePolygonMapItem::~QDeclarativePolygonMapItem() diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h index 83983651..60e81b08 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h @@ -118,7 +118,6 @@ protected: protected Q_SLOTS: void markSourceDirtyAndUpdate(); - void handleBorderUpdated(); virtual void afterViewportChanged(const QGeoMapViewportChangeEvent &event) override; private: -- cgit v1.2.1 From b4beb74d93fee205b624c0f0ae6ea39d88d471ac Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Wed, 28 Nov 2018 10:44:35 +0100 Subject: Fix compilation with GCC < 5.0 Apparently unable to resolve QPointers to pointers Change-Id: I04b3b7698ea083f83bc2713530656ca8b3f3ac28 Fixes: QTBUG-69512 Reviewed-by: Alex Blasche --- src/location/declarativemaps/qdeclarativegeomap.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 09f9d01c..d8d01b66 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -694,11 +694,11 @@ void QDeclarativeGeoMap::mappingManagerInitialized() QImage copyrightImage; if (!m_initialized && width() > 0 && height() > 0) { QMetaObject::Connection copyrightStringCatcherConnection = - connect(m_map, + connect(m_map.data(), QOverload::of(&QGeoMap::copyrightsChanged), [©rightString](const QString ©){ copyrightString = copy; }); QMetaObject::Connection copyrightImageCatcherConnection = - connect(m_map, + connect(m_map.data(), QOverload::of(&QGeoMap::copyrightsChanged), [©rightImage](const QImage ©){ copyrightImage = copy; }); m_map->setViewportSize(QSize(width(), height())); @@ -709,9 +709,9 @@ void QDeclarativeGeoMap::mappingManagerInitialized() /* COPYRIGHT SIGNALS REWIRING */ - connect(m_map, SIGNAL(copyrightsChanged(QImage)), + connect(m_map.data(), SIGNAL(copyrightsChanged(QImage)), this, SIGNAL(copyrightsChanged(QImage))); - connect(m_map, SIGNAL(copyrightsChanged(QString)), + connect(m_map.data(), SIGNAL(copyrightsChanged(QString)), this, SIGNAL(copyrightsChanged(QString))); if (!copyrightString.isEmpty()) emit m_map->copyrightsChanged(copyrightString); @@ -719,8 +719,8 @@ void QDeclarativeGeoMap::mappingManagerInitialized() emit m_map->copyrightsChanged(copyrightImage); - connect(m_map, &QGeoMap::sgNodeChanged, this, &QQuickItem::update); - connect(m_map, &QGeoMap::cameraCapabilitiesChanged, this, &QDeclarativeGeoMap::onCameraCapabilitiesChanged); + connect(m_map.data(), &QGeoMap::sgNodeChanged, this, &QQuickItem::update); + connect(m_map.data(), &QGeoMap::cameraCapabilitiesChanged, this, &QDeclarativeGeoMap::onCameraCapabilitiesChanged); // This prefetches a buffer around the map m_map->prefetchData(); -- cgit v1.2.1