From 587b8812c9b2fc7ed7ad4ab35d27114ee98eafc6 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Sat, 8 Dec 2018 18:45:36 +0100 Subject: Introduce QGeoMapObject::geoShape property In this way MapObjects become a little closer to MapItems, and this property can be used to, for example, center the map on one specific object or object group. Fixes: QTBUG-69640 Change-Id: I4dbead9e670bf5d1eeaccb2bd09d956b8de7da87 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/location/labs/qmappolylineobject.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/location/labs/qmappolylineobject.cpp') diff --git a/src/location/labs/qmappolylineobject.cpp b/src/location/labs/qmappolylineobject.cpp index 1c351962..c6d3cdaf 100644 --- a/src/location/labs/qmappolylineobject.cpp +++ b/src/location/labs/qmappolylineobject.cpp @@ -37,6 +37,7 @@ #include "qmappolylineobject_p.h" #include "qmappolylineobject_p_p.h" #include +#include QT_BEGIN_NAMESPACE @@ -127,6 +128,23 @@ bool QMapPolylineObjectPrivate::equals(const QGeoMapObjectPrivate &other) const && width() == o.width()); } +QGeoShape QMapPolylineObjectPrivate::geoShape() const +{ + return QGeoPath(path()); +} + +void QMapPolylineObjectPrivate::setGeoShape(const QGeoShape &shape) +{ + const QGeoPath p(shape); + if (p == path()) + return; + + setPath(p.path()); // to handle overrides + emit static_cast(q)->pathChanged(); +} + + + QGeoMapObjectPrivate *QMapPolylineObjectPrivateDefault::clone() { return new QMapPolylineObjectPrivateDefault(static_cast(*this)); -- cgit v1.2.1