-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameBlock.h
More file actions
61 lines (44 loc) · 1.03 KB
/
GameBlock.h
File metadata and controls
61 lines (44 loc) · 1.03 KB
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
51
52
53
54
55
56
57
58
59
60
61
#ifndef GAMEBLOCK_H
#define GAMEBLOCK_H
#include <QTextCodec>
#include <QLabel>
#include <QPixmap>
#include <QMouseEvent>
#include <QDebug>
#include <QSound>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QLCDNumber>
#include <QPushButton>
#include <QTimer>
#include <QTime>
#include <QMessageBox>
#include <QQueue>
#include <QStateMachine>
#include <QFinalState>
class Block : public QLabel
{
Q_OBJECT
public:
explicit Block(QWidget* parent = 0);
~Block();
//重写鼠标事件
void mousePressEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *e);
//设置周围雷数
void setNumber(const int & number);
bool m_flagIsMine; //是否是雷
//是不是已经被翻开
bool isTurnOver();
//将图片翻开
void turnOver();
signals:
void sigIsMine(bool);
void sigMark(bool);
private:
bool m_flagLeft; //是否被左键点击
bool m_flagRight; //是否被右键标记
int m_number; //周围雷的数量
};
#endif // BLOCK_H