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:
parent
f5478b8a63
commit
6a1a11879d
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user