qcocoadrag: use rvalue overload more

to reuse internal buffer

Change-Id: Iab24bf8ff40edc1b64227ab6dbdff02f926b1008
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Anton Kudryavtsev 2023-09-07 15:50:20 +03:00
parent f5478b8a63
commit 6a1a11879d

View File

@ -244,9 +244,9 @@ QPixmap QCocoaDrag::dragPixmap(QDrag *drag, QPoint &hotSpot) const
QFontMetrics fm(f);
if (data->hasImage()) {
const QImage img = data->imageData().value<QImage>();
QImage img = data->imageData().value<QImage>();
if (!img.isNull()) {
pm = QPixmap::fromImage(img).scaledToWidth(dragImageMaxChars *fm.averageCharWidth());
pm = QPixmap::fromImage(std::move(img)).scaledToWidth(dragImageMaxChars *fm.averageCharWidth());
}
}