Change const T&& parameters to T&& to enable proper move semantics

Previously some constructors/functions used `const T&&`, which prevents
calling the move constructor. This commit removes the `const` qualifier
so that `std::move` actually performs a move.
This commit is contained in:
Sean Wei
2025-06-18 15:30:00 -04:00
committed by John Preston
parent e6ebc19b4f
commit 5a6a5fd4d1
6 changed files with 6 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Editor {
ItemImage::ItemImage(
const QPixmap &&pixmap,
QPixmap &&pixmap,
ItemBase::Data data)
: ItemBase(std::move(data))
, _pixmap(std::move(pixmap)) {

View File

@@ -14,7 +14,7 @@ namespace Editor {
class ItemImage : public ItemBase {
public:
ItemImage(
const QPixmap &&pixmap,
QPixmap &&pixmap,
ItemBase::Data data);
void paint(
QPainter *p,

View File

@@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Editor {
ItemLine::ItemLine(const QPixmap &&pixmap)
ItemLine::ItemLine(QPixmap &&pixmap)
: _pixmap(std::move(pixmap))
, _rect(QPointF(), _pixmap.size() / float64(style::DevicePixelRatio())) {
}

View File

@@ -13,7 +13,7 @@ namespace Editor {
class ItemLine : public NumberedItem {
public:
ItemLine(const QPixmap &&pixmap);
ItemLine(QPixmap &&pixmap);
QRectF boundingRect() const override;
void paint(
QPainter *p,