mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-15 10:08:08 +01:00
Check QT_VERSION_CHECK for QImage::sizeInBytes() or QImage::byteCount()
This commit is contained in:
parent
5f7efee00e
commit
b5dd90b2d5
@ -91,7 +91,11 @@ QDBusArgument &operator<<(QDBusArgument &arg, const QImage &image) {
|
|||||||
int channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3);
|
int channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3);
|
||||||
arg << i.depth() / channels;
|
arg << i.depth() / channels;
|
||||||
arg << channels;
|
arg << channels;
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||||
arg << QByteArray(reinterpret_cast<const char*>(i.bits()), i.sizeInBytes());
|
arg << QByteArray(reinterpret_cast<const char*>(i.bits()), i.sizeInBytes());
|
||||||
|
#else
|
||||||
|
arg << QByteArray(reinterpret_cast<const char*>(i.bits()), i.byteCount());
|
||||||
|
#endif
|
||||||
arg.endStructure();
|
arg.endStructure();
|
||||||
return arg;
|
return arg;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user