summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-07-11 19:19:04 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-07-12 20:42:29 +0300
commit4014aa6721e53318e4ac92814776b3e01b4589cb (patch)
treedd57dfb64f5db1a9afaf7ab94cfa9aaeaae1392b /platform
parent2fae373fc9da1a5ed61b5114d8c982073734826d (diff)
downloadqtlocation-mapboxgl-4014aa6721e53318e4ac92814776b3e01b4589cb.tar.gz
[core] GCC 4.9 bracket initialization issues
Diffstat (limited to 'platform')
-rw-r--r--platform/qt/app/mapwindow.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp
index 03ca052ec4..c4efbfa318 100644
--- a/platform/qt/app/mapwindow.cpp
+++ b/platform/qt/app/mapwindow.cpp
@@ -254,8 +254,13 @@ void MapWindow::keyPressEvent(QKeyEvent *ev)
if (m_lineAnnotationId.isNull()) {
QMapbox::Coordinate topLeft = m_map->coordinateForPixel({ 0, 0 });
QMapbox::Coordinate bottomRight = m_map->coordinateForPixel({ qreal(size().width()), qreal(size().height()) });
- QMapbox::CoordinatesCollections geometry { { { topLeft, bottomRight } } };
- QMapbox::LineAnnotation line { { QMapbox::ShapeAnnotationGeometry::LineStringType, geometry }, 0.5f, 1.0f, Qt::red };
+ QMapbox::CoordinatesCollections lineGeometry { { { topLeft, bottomRight } } };
+ QMapbox::ShapeAnnotationGeometry annotationGeometry { QMapbox::ShapeAnnotationGeometry::LineStringType, lineGeometry };
+ QMapbox::LineAnnotation line;
+ line.geometry = annotationGeometry;
+ line.opacity = 0.5f;
+ line.width = 1.0f;
+ line.color = Qt::red;
m_lineAnnotationId = m_map->addAnnotation(QVariant::fromValue<QMapbox::LineAnnotation>(line));
} else {
m_map->removeAnnotation(m_lineAnnotationId.toUInt());
@@ -269,8 +274,13 @@ void MapWindow::keyPressEvent(QKeyEvent *ev)
QMapbox::Coordinate topRight = m_map->coordinateForPixel({ 0, qreal(size().height()) });
QMapbox::Coordinate bottomLeft = m_map->coordinateForPixel({ qreal(size().width()), 0 });
QMapbox::Coordinate bottomRight = m_map->coordinateForPixel({ qreal(size().width()), qreal(size().height()) });
- QMapbox::CoordinatesCollections geometry { { { bottomLeft, bottomRight, topRight, topLeft, bottomLeft } } };
- QMapbox::FillAnnotation fill { { QMapbox::ShapeAnnotationGeometry::PolygonType, geometry }, 0.5f, Qt::green, QVariant::fromValue<QColor>(QColor(Qt::black)) };
+ QMapbox::CoordinatesCollections fillGeometry { { { bottomLeft, bottomRight, topRight, topLeft, bottomLeft } } };
+ QMapbox::ShapeAnnotationGeometry annotationGeometry { QMapbox::ShapeAnnotationGeometry::PolygonType, fillGeometry };
+ QMapbox::FillAnnotation fill;
+ fill.geometry = annotationGeometry;
+ fill.opacity = 0.5f;
+ fill.color = Qt::green;
+ fill.outlineColor = QVariant::fromValue<QColor>(QColor(Qt::black));
m_fillAnnotationId = m_map->addAnnotation(QVariant::fromValue<QMapbox::FillAnnotation>(fill));
} else {
m_map->removeAnnotation(m_fillAnnotationId.toUInt());
@@ -283,8 +293,8 @@ void MapWindow::keyPressEvent(QKeyEvent *ev)
m_map->removeLayer("circleLayer");
m_map->removeSource("circleSource");
} else {
- QMapbox::CoordinatesCollections geometry { { { m_map->coordinate() } } };
- QMapbox::Feature feature { QMapbox::Feature::PointType, geometry, {}, {} };
+ QMapbox::CoordinatesCollections point { { { m_map->coordinate() } } };
+ QMapbox::Feature feature { QMapbox::Feature::PointType, point, {}, {} };
QVariantMap circleSource;
circleSource["type"] = "geojson";