platforms/windows: use qimage rvalue overloads more
Change-Id: If827f0daa5036dbc9855c0209ec0621a9e8bf78e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
parent
0ed8db7800
commit
1e25bf5f4d
@ -138,8 +138,8 @@ static HCURSOR createBitmapCursor(const QCursor &cursor, qreal scaleFactor = 1)
|
||||
bbits = bbits.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
mbits = mbits.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
}
|
||||
bbits = bbits.convertToFormat(QImage::Format_Mono);
|
||||
mbits = mbits.convertToFormat(QImage::Format_Mono);
|
||||
bbits = std::move(bbits).convertToFormat(QImage::Format_Mono);
|
||||
mbits = std::move(mbits).convertToFormat(QImage::Format_Mono);
|
||||
const bool invb = bbits.colorCount() > 1 && qGray(bbits.color(0)) < qGray(bbits.color(1));
|
||||
const bool invm = mbits.colorCount() > 1 && qGray(mbits.color(0)) < qGray(mbits.color(1));
|
||||
return createBitmapCursor(bbits, mbits, cursor.hotSpot(), invb, invm);
|
||||
|
@ -154,7 +154,7 @@ static bool qt_write_dibv5(QDataStream &s, QImage image)
|
||||
return false;
|
||||
|
||||
if (image.format() != QImage::Format_ARGB32)
|
||||
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||
image = std::move(image).convertToFormat(QImage::Format_ARGB32);
|
||||
|
||||
auto *buf = new uchar[bpl_bmp];
|
||||
|
||||
@ -870,7 +870,7 @@ bool QWindowsMimeImage::convertFromMime(const FORMATETC &formatetc, const QMimeD
|
||||
QByteArray ba;
|
||||
if (cf == CF_DIB) {
|
||||
if (img.format() > QImage::Format_ARGB32)
|
||||
img = img.convertToFormat(QImage::Format_RGB32);
|
||||
img = std::move(img).convertToFormat(QImage::Format_RGB32);
|
||||
const QByteArray ba = writeDib(img);
|
||||
if (!ba.isEmpty())
|
||||
return setData(ba, pmedium);
|
||||
@ -883,7 +883,7 @@ bool QWindowsMimeImage::convertFromMime(const FORMATETC &formatetc, const QMimeD
|
||||
} else {
|
||||
QDataStream s(&ba, QIODevice::WriteOnly);
|
||||
s.setByteOrder(QDataStream::LittleEndian);// Intel byte order ####
|
||||
if (qt_write_dibv5(s, img))
|
||||
if (qt_write_dibv5(s, std::move(img)))
|
||||
return setData(ba, pmedium);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user