From 4014aa6721e53318e4ac92814776b3e01b4589cb Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 11 Jul 2017 19:19:04 +0300 Subject: [core] GCC 4.9 bracket initialization issues --- platform/qt/app/mapwindow.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'platform') 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(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(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(Qt::black)); m_fillAnnotationId = m_map->addAnnotation(QVariant::fromValue(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"; -- cgit v1.2.1