mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-29 10:03:55 -07:00
counters menu
This commit is contained in:
parent
7baff1ab62
commit
85319ecc28
6 changed files with 258 additions and 200 deletions
|
|
@ -4,22 +4,35 @@
|
|||
#include <QGraphicsItem>
|
||||
|
||||
class Player;
|
||||
class QMenu;
|
||||
class QAction;
|
||||
|
||||
class Counter : public QGraphicsItem {
|
||||
class Counter : public QObject, public QGraphicsItem {
|
||||
Q_OBJECT
|
||||
private:
|
||||
Player *player;
|
||||
int id;
|
||||
QString name;
|
||||
QColor color;
|
||||
int radius;
|
||||
int value;
|
||||
|
||||
QAction *aSet, *aDec, *aInc;
|
||||
QMenu *menu;
|
||||
private slots:
|
||||
void incrementCounter();
|
||||
void setCounter();
|
||||
protected:
|
||||
Player *player;
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
public:
|
||||
Counter(Player *_player, int _id, const QString &_name, QColor _color, int _radius, int _value, QGraphicsItem *parent = 0);
|
||||
~Counter();
|
||||
QRectF boundingRect() const;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
QMenu *getMenu() const { return menu; }
|
||||
void retranslateUi();
|
||||
|
||||
int getId() const { return id; }
|
||||
QString getName() const { return name; }
|
||||
int getValue() const { return value; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue