diff --git a/src/osd/osddbus.cpp b/src/osd/osddbus.cpp index ef6394b8..36d0f01d 100644 --- a/src/osd/osddbus.cpp +++ b/src/osd/osddbus.cpp @@ -78,19 +78,21 @@ QDBusArgument &operator<<(QDBusArgument &arg, const QImage &image) { #endif arg.beginStructure(); - arg << i.width(); - arg << i.height(); + arg << static_cast(i.width()); + arg << static_cast(i.height()); arg << static_cast(i.bytesPerLine()); arg << i.hasAlphaChannel(); - int channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3); - arg << i.depth() / channels; + qint32 channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3); + qint32 bitspersample = i.depth() / channels; + arg << bitspersample; arg << channels; #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) - arg << QByteArray(reinterpret_cast(i.bits()), i.sizeInBytes()); + arg << QByteArray(reinterpret_cast(i.constBits()), static_cast(i.sizeInBytes())); #else - arg << QByteArray(reinterpret_cast(i.bits()), i.byteCount()); + arg << QByteArray(reinterpret_cast(i.constBits()), i.byteCount()); #endif arg.endStructure(); + return arg; }