-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathCardPic.h
50 lines (37 loc) · 892 Bytes
/
CardPic.h
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
43
44
45
46
47
48
49
50
#ifndef CARDPIC_H
#define CARDPIC_H
#include <QWidget>
#include <QPaintEvent>
#include <QMouseEvent>
#include <QPixmap>
#include "Cards.h"
class Player;
class CardPic : public QWidget
{
Q_OBJECT
public:
explicit CardPic(QWidget *parent = 0);
void SetPic(const QPixmap& pic, const QPixmap& back);
QPixmap GetPic();
void SetOwner(Player* owner);
Player* GetOwner();
void SetCard(Card card);
Card GetCard();
void SetFrontSide(bool frontSide);
bool IsFrontSide();
void SetSelected(bool selected);
bool IsSelected();
signals:
void NotifySelected(Qt::MouseButton);
protected:
virtual void paintEvent(QPaintEvent* event);
virtual void mousePressEvent(QMouseEvent* event);
protected:
QPixmap m_pic;
QPixmap m_back;
Player* m_owner;
Card m_card;
bool m_selected;
bool m_frontSide;
};
#endif // CARDPIC_H