[qt] Deprecation warnings and Qt compatibility fixes (#118)

* [qt] Fix compilation of the sqlite wrapper

* [qt] Fix QImage-related warnings

* Update Qt redirection handling

Since 5.9 RedirectPolicyAttribute is preferred, and from 6.0 the
behavior of NoLessSafeRedirectPolicy is the default.

* [qt] Fix more deprecation warnings

Co-authored-by: Mårten Nordheim <morten242@gmail.com>
This commit is contained in:
Tadej Novak
2021-07-16 09:52:48 +02:00
committed by GitHub
parent 043a06d803
commit aef3d4dd74
6 changed files with 43 additions and 5 deletions

View File

@@ -109,8 +109,13 @@ std::unique_ptr<mbgl::style::Image> toStyleImage(const QString &id, const QImage
.rgbSwapped()
.convertToFormat(QImage::Format_ARGB32_Premultiplied);
#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
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(),