1
0
mirror of https://github.com/KDE/krfb synced 2026-07-01 07:41:17 -07:00

Fix warning when compiling with Qt >= 5.10

This commit is contained in:
Alexey Min
2019-05-18 02:05:16 +03:00
parent 61cedda6b3
commit 6ecb4248b8

View File

@@ -26,7 +26,11 @@ QtFrameBuffer::QtFrameBuffer(WId id, QObject *parent)
if (screen) {
primaryScreen = screen;
fbImage = screen->grabWindow(win).toImage();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
fb = new char[fbImage.sizeInBytes()];
#else
fb = new char[fbImage.byteCount()];
#endif
} else {
fb = nullptr;
primaryScreen = nullptr;
@@ -104,7 +108,11 @@ void QtFrameBuffer::updateFrameBuffer()
tiles.append(img.rect());
#endif
memcpy(fb, (const char *)img.bits(), img.byteCount());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
memcpy(fb, img.bits(), static_cast<size_t>(img.sizeInBytes()));
#else
memcpy(fb, img.bits(), img.byteCount());
#endif
fbImage = img;
}