Use QImage::sizeInBytes() with Qt 5.10 and above
This commit is contained in:
parent
1bf40fee15
commit
e98c11fe64
@ -66,7 +66,11 @@ QDBusArgument& operator<<(QDBusArgument& arg, const QImage& image) {
|
||||
int channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3);
|
||||
arg << i.depth() / channels;
|
||||
arg << channels;
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
arg << QByteArray(reinterpret_cast<const char*>(i.bits()), i.sizeInBytes());
|
||||
#else
|
||||
arg << QByteArray(reinterpret_cast<const char*>(i.bits()), i.byteCount());
|
||||
#endif
|
||||
arg.endStructure();
|
||||
return arg;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user