decklist transfer code

This commit is contained in:
Max-Wilhelm Bruker 2009-11-22 00:34:31 +01:00
parent 63f9206eb4
commit 8dcf81654e
32 changed files with 694 additions and 260 deletions

View file

@ -0,0 +1,43 @@
#ifndef ABSTRACTCARDITEM_H
#define ABSTRACTCARDITEM_H
#include "abstractgraphicsitem.h"
class CardInfo;
const int CARD_WIDTH = 72;
const int CARD_HEIGHT = 102;
enum CardItemType {
typeCard = QGraphicsItem::UserType + 1,
typeCardDrag = QGraphicsItem::UserType + 2,
typeZone = QGraphicsItem::UserType + 3,
typeOther = QGraphicsItem::UserType + 4
};
class AbstractCardItem : public QObject, public AbstractGraphicsItem {
Q_OBJECT
protected:
CardInfo *info;
QString name;
bool tapped;
private slots:
void pixmapUpdated();
public:
enum { Type = typeCard };
int type() const { return Type; }
AbstractCardItem(const QString &_name = QString(), QGraphicsItem *parent = 0);
~AbstractCardItem();
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
CardInfo *getInfo() const { return info; }
QString getName() const { return name; }
void setName(const QString &_name = QString());
bool getTapped() const { return tapped; }
void setTapped(bool _tapped);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
};
#endif