QImage: use rvalue overloads more

to reuse internal buffers
This commit is contained in:
Fushan Wen 2023-09-16 20:01:55 +08:00
parent 8ab1880d9f
commit b43432326b
No known key found for this signature in database
GPG key ID: 2E48D1487C91DCAA

View file

@ -383,7 +383,7 @@ QSharedPointer<QIODevice> DBusNotificationsListener::iconForImageData(const QVar
QImage image(reinterpret_cast<uchar *>(imageData.data()), width, height, rowStride, hasAlpha ? QImage::Format_ARGB32 : QImage::Format_RGB32);
if (hasAlpha) {
image = image.rgbSwapped(); // RGBA --> ARGB
image = std::move(image).rgbSwapped(); // RGBA --> ARGB
}
QSharedPointer<QIODevice> buffer = iconFromQImage(image);