summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-08-21 09:57:31 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-09-04 11:50:53 +0300
commit5233c75b3f6c73623c5473b2d6573f31f3ddb4b7 (patch)
tree3b0b4001141bc444dd375aeedf626987686eb2a6
parent4b85252fbe811a786c6ee9eabedb7639b031dc53 (diff)
downloadqtlocation-mapboxgl-5233c75b3f6c73623c5473b2d6573f31f3ddb4b7.tar.gz
[qt] Fix Qt version comparison
Because the version is represented in hex, 0x051000 is not the same as Qt 5.10, which means that the deprecated code will be enabled for versions smaller than 5.16.
-rw-r--r--platform/qt/src/qmapboxgl.cpp2
-rw-r--r--platform/qt/src/qt_image.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index 09479581bb..094eaca5ac 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -136,7 +136,7 @@ std::unique_ptr<mbgl::style::Image> toStyleImage(const QString &id, const QImage
.rgbSwapped()
.convertToFormat(QImage::Format_ARGB32_Premultiplied);
-#if QT_VERSION >= 0x051000
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
auto img = std::make_unique<uint8_t[]>(swapped.sizeInBytes());
memcpy(img.get(), swapped.constBits(), swapped.sizeInBytes());
#else
diff --git a/platform/qt/src/qt_image.cpp b/platform/qt/src/qt_image.cpp
index a5c92514c1..8fff1e88b6 100644
--- a/platform/qt/src/qt_image.cpp
+++ b/platform/qt/src/qt_image.cpp
@@ -54,7 +54,7 @@ PremultipliedImage decodeImage(const std::string& string) {
throw std::runtime_error("Unsupported image type");
}
-#if QT_VERSION >= 0x051000
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
auto img = std::make_unique<uint8_t[]>(image.sizeInBytes());
memcpy(img.get(), image.constBits(), image.sizeInBytes());
#else