AyuGramDesktop/Telegram/SourceFiles/editor/scene/scene_item_line.h
Sean Wei 5a6a5fd4d1 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.
2025-06-27 20:50:08 +04:00

44 lines
1,014 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "editor/scene/scene_item_base.h"
namespace Editor {
class ItemLine : public NumberedItem {
public:
ItemLine(QPixmap &&pixmap);
QRectF boundingRect() const override;
void paint(
QPainter *p,
const QStyleOptionGraphicsItem *option,
QWidget *widget) override;
bool hasState(SaveState state) const override;
void save(SaveState state) override;
void restore(SaveState state) override;
protected:
bool collidesWithItem(
const QGraphicsItem *,
Qt::ItemSelectionMode) const override;
bool collidesWithPath(
const QPainterPath &,
Qt::ItemSelectionMode) const override;
private:
const QPixmap _pixmap;
const QRectF _rect;
struct {
bool saved = false;
NumberedItem::Status status;
} _saved, _keeped;
};
} // namespace Editor