summaryrefslogtreecommitdiffstats
path: root/src/imports/location/qdeclarativepolygonmapitem.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@jollamobile.com>2013-12-18 15:15:58 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-11 01:02:51 +0100
commit334b9f3b0c4acb77db7254380c4a96cea6d589a8 (patch)
treeeac101b47ec011783c050189ed8f3dbdef65d0e1 /src/imports/location/qdeclarativepolygonmapitem.cpp
parent1e58cb04817a3ea6fbed45d5bbb9e6aea99b282d (diff)
Fix declarative_ui tests.
Coordinates for map items located outside the view port cannot be converted to and from screen coordinates. During tests pan the map so that the items under tests are inside the view port. Tests for panning the map and dragging map items were failing because mapping between coordinates and screen position only works for visible screen positions. The MouseAreas under test did not have preventStealing set, which was causing the map to pan slightly prior to item drag being detected. Stop gesture detection for a touch point when the mouse is grabbed by a child item. Task-number: QTBUG-31797 Change-Id: I42a801d50c194c6fe9629f3b0de606b406ad8b8c Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/imports/location/qdeclarativepolygonmapitem.cpp')
-rw-r--r--src/imports/location/qdeclarativepolygonmapitem.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp
index 9ba9c4e7..55261ed1 100644
--- a/src/imports/location/qdeclarativepolygonmapitem.cpp
+++ b/src/imports/location/qdeclarativepolygonmapitem.cpp
@@ -351,7 +351,7 @@ QDeclarativePolygonMapItem::~QDeclarativePolygonMapItem()
\qmlproperty color MapPolygon::border.color
This property is part of the border property group. The border property
- group holds the width and color used to draw the border of the circle.
+ group holds the width and color used to draw the border of the polygon.
The width is in pixels and is independent of the zoom level of the map.
@@ -546,23 +546,21 @@ void QDeclarativePolygonMapItem::updateMapItem()
geometry_.updateSourcePoints(*map(), path_);
geometry_.updateScreenPoints(*map());
- if (border_.color() != Qt::transparent && border_.width() > 0) {
- QList<QGeoCoordinate> closedPath = path_;
- closedPath << closedPath.first();
- borderGeometry_.updateSourcePoints(*map(), closedPath);
+ QList<QGeoCoordinate> closedPath = path_;
+ closedPath << closedPath.first();
+ borderGeometry_.clear();
+ borderGeometry_.updateSourcePoints(*map(), closedPath);
+
+ if (border_.color() != Qt::transparent && border_.width() > 0)
borderGeometry_.updateScreenPoints(*map(), border_.width());
- QList<QGeoMapItemGeometry *> geoms;
- geoms << &geometry_ << &borderGeometry_;
- QRectF combined = QGeoMapItemGeometry::translateToCommonOrigin(geoms);
+ QList<QGeoMapItemGeometry *> geoms;
+ geoms << &geometry_ << &borderGeometry_;
+ QRectF combined = QGeoMapItemGeometry::translateToCommonOrigin(geoms);
+
+ setWidth(combined.width());
+ setHeight(combined.height());
- setWidth(combined.width());
- setHeight(combined.height());
- } else {
- borderGeometry_.clear();
- setWidth(geometry_.sourceBoundingBox().width());
- setHeight(geometry_.sourceBoundingBox().height());
- }
setPositionOnMap(path_.at(0), -1 * geometry_.sourceBoundingBox().topLeft());
update();
}