diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-01-31 17:19:38 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-07-18 16:33:15 +0300 |
commit | 3f225c01cea9483f4f6e40c9c6eba6ecdf3c3af0 (patch) | |
tree | c04f9678ff979c45326da4ebbd4e113b79fb87f3 | |
parent | 084657f43ec304b4ec6d3cb7bbc7ddb2320e688e (diff) | |
download | qtlocation-mapboxgl-upstream/tmpsantos-gcc49_qt.tar.gz |
[Qt] Avoid using brace-list init ctor in QMapboxGLupstream/tmpsantos-gcc49_qt
-rw-r--r-- | platform/qt/include/qmapbox.hpp | 22 | ||||
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 16 |
2 files changed, 30 insertions, 8 deletions
diff --git a/platform/qt/include/qmapbox.hpp b/platform/qt/include/qmapbox.hpp index 1b61d3270f..9648e5413e 100644 --- a/platform/qt/include/qmapbox.hpp +++ b/platform/qt/include/qmapbox.hpp @@ -26,6 +26,12 @@ struct Q_DECL_EXPORT Feature { LineStringType, PolygonType }; + + Feature() {} + + Feature(Type type_, const CoordinatesCollections& geometry_, const QVariantMap& properties_, const QVariant& id_) + : type(type_), geometry(geometry_), properties(properties_), id(id_) {} + Type type; CoordinatesCollections geometry; QVariantMap properties; @@ -39,6 +45,12 @@ struct Q_DECL_EXPORT ShapeAnnotationGeometry { MultiLineStringType, MultiPolygonType }; + + ShapeAnnotationGeometry() {} + + ShapeAnnotationGeometry(Type type_, const CoordinatesCollections& geometry_) + : type(type_), geometry(geometry_) {} + Type type; CoordinatesCollections geometry; }; @@ -49,6 +61,11 @@ struct Q_DECL_EXPORT SymbolAnnotation { }; struct Q_DECL_EXPORT LineAnnotation { + LineAnnotation() {} + + LineAnnotation(const ShapeAnnotationGeometry& geometry_, float opacity_, float width_, const QColor& color_) + : geometry(geometry_), opacity(opacity_), width(width_), color(color_) {} + ShapeAnnotationGeometry geometry; float opacity = 1.0f; float width = 1.0f; @@ -56,6 +73,11 @@ struct Q_DECL_EXPORT LineAnnotation { }; struct Q_DECL_EXPORT FillAnnotation { + FillAnnotation() {} + + FillAnnotation(const ShapeAnnotationGeometry& geometry_, float opacity_, const QColor& color_, const QVariant& outlineColor_ = QVariant()) + : geometry(geometry_), opacity(opacity_), color(color_), outlineColor(outlineColor_) {} + ShapeAnnotationGeometry geometry; float opacity = 1.0f; QColor color = Qt::black; diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index 06901b13ba..b79630b3df 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -780,16 +780,16 @@ mbgl::optional<mbgl::Annotation> asMapboxGLAnnotation(const QMapbox::Annotation mbgl::ShapeAnnotationGeometry result; switch (geometry.type) { case QMapbox::ShapeAnnotationGeometry::LineStringType: - result = { asMapboxGLLineString(geometry.geometry.first().first()) }; + result = asMapboxGLLineString(geometry.geometry.first().first()); break; case QMapbox::ShapeAnnotationGeometry::PolygonType: - result = { asMapboxGLPolygon(geometry.geometry.first()) }; + result = asMapboxGLPolygon(geometry.geometry.first()); break; case QMapbox::ShapeAnnotationGeometry::MultiLineStringType: - result = { asMapboxGLMultiLineString(geometry.geometry.first()) }; + result = asMapboxGLMultiLineString(geometry.geometry.first()); break; case QMapbox::ShapeAnnotationGeometry::MultiPolygonType: - result = { asMapboxGLMultiPolygon(geometry.geometry) }; + result = asMapboxGLMultiPolygon(geometry.geometry); break; } return result; @@ -798,19 +798,19 @@ mbgl::optional<mbgl::Annotation> asMapboxGLAnnotation(const QMapbox::Annotation if (annotation.canConvert<QMapbox::SymbolAnnotation>()) { QMapbox::SymbolAnnotation symbolAnnotation = annotation.value<QMapbox::SymbolAnnotation>(); QMapbox::Coordinate& pair = symbolAnnotation.geometry; - return { mbgl::SymbolAnnotation { mbgl::Point<double> { pair.second, pair.first }, symbolAnnotation.icon.toStdString() } }; + return { mbgl::SymbolAnnotation(mbgl::Point<double> { pair.second, pair.first }, symbolAnnotation.icon.toStdString()) }; } else if (annotation.canConvert<QMapbox::LineAnnotation>()) { QMapbox::LineAnnotation lineAnnotation = annotation.value<QMapbox::LineAnnotation>(); auto color = mbgl::Color::parse(lineAnnotation.color.name().toStdString()); - return { mbgl::LineAnnotation { asMapboxGLGeometry(lineAnnotation.geometry), lineAnnotation.opacity, lineAnnotation.width, { *color } } }; + return { mbgl::LineAnnotation(asMapboxGLGeometry(lineAnnotation.geometry), lineAnnotation.opacity, lineAnnotation.width, { *color }) }; } else if (annotation.canConvert<QMapbox::FillAnnotation>()) { QMapbox::FillAnnotation fillAnnotation = annotation.value<QMapbox::FillAnnotation>(); auto color = mbgl::Color::parse(fillAnnotation.color.name().toStdString()); if (fillAnnotation.outlineColor.canConvert<QColor>()) { auto outlineColor = mbgl::Color::parse(fillAnnotation.outlineColor.value<QColor>().name().toStdString()); - return { mbgl::FillAnnotation { asMapboxGLGeometry(fillAnnotation.geometry), fillAnnotation.opacity, { *color }, { *outlineColor } } }; + return { mbgl::FillAnnotation(asMapboxGLGeometry(fillAnnotation.geometry), fillAnnotation.opacity, { *color }, { *outlineColor }) }; } else { - return { mbgl::FillAnnotation { asMapboxGLGeometry(fillAnnotation.geometry), fillAnnotation.opacity, { *color }, {} } }; + return { mbgl::FillAnnotation(asMapboxGLGeometry(fillAnnotation.geometry), fillAnnotation.opacity, { *color }, {}) }; } } |