summaryrefslogtreecommitdiff
path: root/platform/qt/src/qmapboxgl.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-11-13 13:36:55 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-11-13 11:47:31 -0200
commit10a9b25928bd8cd28f0c459de1f083e206e473e5 (patch)
tree9fdf5a3a55b09f23d6e809c0ba37a9be308b64cb /platform/qt/src/qmapboxgl.cpp
parent92608f58858d77c17a65ae9b29758e74bb2da7d2 (diff)
downloadqtlocation-mapboxgl-10a9b25928bd8cd28f0c459de1f083e206e473e5.tar.gz
[Qt] Fix deprecation warnings in Qt 5.10
Diffstat (limited to 'platform/qt/src/qmapboxgl.cpp')
-rw-r--r--platform/qt/src/qmapboxgl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index fc281fdf1d..c9f85adf4c 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -111,8 +111,13 @@ std::unique_ptr<mbgl::style::Image> toStyleImage(const QString &id, const QImage
.rgbSwapped()
.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+#if QT_VERSION >= 0x051000
+ auto img = std::make_unique<uint8_t[]>(swapped.sizeInBytes());
+ memcpy(img.get(), swapped.constBits(), swapped.sizeInBytes());
+#else
auto img = std::make_unique<uint8_t[]>(swapped.byteCount());
memcpy(img.get(), swapped.constBits(), swapped.byteCount());
+#endif
return std::make_unique<mbgl::style::Image>(
id.toStdString(),