From e98c11fe649da7eb9457d6f281f885eeb071e4c3 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 5 Jan 2020 19:31:40 +0100 Subject: [PATCH] Use QImage::sizeInBytes() with Qt 5.10 and above --- src/widgets/osd_x11.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/widgets/osd_x11.cpp b/src/widgets/osd_x11.cpp index 55bf7db0e..ee6829ca2 100644 --- a/src/widgets/osd_x11.cpp +++ b/src/widgets/osd_x11.cpp @@ -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(i.bits()), i.sizeInBytes()); +#else arg << QByteArray(reinterpret_cast(i.bits()), i.byteCount()); +#endif arg.endStructure(); return arg; }