Qt: Fix build on Qt < 5.10

This commit is contained in:
Vicki Pfau 2020-02-23 18:08:00 -08:00
parent 210c7a91cd
commit 75fa9a80fa
1 changed files with 6 additions and 0 deletions

View File

@ -689,6 +689,12 @@ void CoreController::scanCard(const QString& path) {
m_eReaderData = file.read(2912); m_eReaderData = file.read(2912);
} else if (image.size() == QSize(989, 44)) { } else if (image.size() == QSize(989, 44)) {
const uchar* bits = image.constBits(); const uchar* bits = image.constBits();
size_t size;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
size = image.sizeInBytes();
#else
size = image.byteCount();
#endif
m_eReaderData.setRawData(reinterpret_cast<const char*>(bits), image.sizeInBytes()); m_eReaderData.setRawData(reinterpret_cast<const char*>(bits), image.sizeInBytes());
} }