[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:
@@ -45,8 +45,13 @@ PremultipliedImage decodeImage(const std::string& string) {
|
||||
throw std::runtime_error("Unsupported image type");
|
||||
}
|
||||
|
||||
#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
|
||||
auto img = std::make_unique<uint8_t[]>(image.byteCount());
|
||||
memcpy(img.get(), image.constBits(), image.byteCount());
|
||||
#endif
|
||||
|
||||
return { { static_cast<uint32_t>(image.width()), static_cast<uint32_t>(image.height()) },
|
||||
std::move(img) };
|
||||
|
||||
Reference in New Issue
Block a user