From b5dd90b2d5ea755f44717eaa19df69c9292b9b2f Mon Sep 17 00:00:00 2001
From: Jonas Kvinge <jonas@jkvinge.net>
Date: Mon, 8 Jul 2019 23:35:43 +0200
Subject: [PATCH] Check QT_VERSION_CHECK for QImage::sizeInBytes() or
 QImage::byteCount()

---
 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 92cf876ab..372dfe40c 100644
--- a/src/widgets/osd_x11.cpp
+++ b/src/widgets/osd_x11.cpp
@@ -91,7 +91,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;