From 5233c75b3f6c73623c5473b2d6573f31f3ddb4b7 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Wed, 21 Aug 2019 09:57:31 +0200 Subject: [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. --- platform/qt/src/qmapboxgl.cpp | 2 +- platform/qt/src/qt_image.cpp | 2 +- 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 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(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(image.sizeInBytes()); memcpy(img.get(), image.constBits(), image.sizeInBytes()); #else -- cgit v1.2.1