1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
/*
SPDX-FileCopyrightText: 1999-2006 Éric Bischoff <ebischoff@nerim.net>
SPDX-FileCopyrightText: 2007 Albert Astals Cid <aacid@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Object to draw on the game board */
#ifndef _TODRAW_H_
#define _TODRAW_H_
#include <QGraphicsSvgItem>
class ToDraw : public QGraphicsSvgItem
{
public:
ToDraw();
void save(QDataStream &stream) const;
bool load(QDataStream &stream);
bool contains(const QPointF &point) const override;
enum { Type = UserType + 1 };
int type() const override;
QRectF boundingRect() const override;
QRectF unclippedRect() const;
void setBeingDragged(bool dragged);
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
private:
QRectF clippedRectAt(const QPointF &somePos) const;
bool m_beingDragged;
};
#endif
|