Always use qint32 for QDBusArgument
This commit is contained in:
parent
82142751de
commit
51b379502f
|
@ -78,19 +78,21 @@ QDBusArgument &operator<<(QDBusArgument &arg, const QImage &image) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
arg.beginStructure();
|
arg.beginStructure();
|
||||||
arg << i.width();
|
arg << static_cast<qint32>(i.width());
|
||||||
arg << i.height();
|
arg << static_cast<qint32>(i.height());
|
||||||
arg << static_cast<qint32>(i.bytesPerLine());
|
arg << static_cast<qint32>(i.bytesPerLine());
|
||||||
arg << i.hasAlphaChannel();
|
arg << i.hasAlphaChannel();
|
||||||
int channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3);
|
qint32 channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3);
|
||||||
arg << i.depth() / channels;
|
qint32 bitspersample = i.depth() / channels;
|
||||||
|
arg << bitspersample;
|
||||||
arg << channels;
|
arg << channels;
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
#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.constBits()), static_cast<int>(i.sizeInBytes()));
|
||||||
#else
|
#else
|
||||||
arg << QByteArray(reinterpret_cast<const char*>(i.bits()), i.byteCount());
|
arg << QByteArray(reinterpret_cast<const char*>(i.constBits()), i.byteCount());
|
||||||
#endif
|
#endif
|
||||||
arg.endStructure();
|
arg.endStructure();
|
||||||
|
|
||||||
return arg;
|
return arg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue