-
Notifications
You must be signed in to change notification settings - Fork 1
/
gamewidget.h
55 lines (50 loc) · 1.24 KB
/
gamewidget.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
51
52
53
54
55
#ifndef GAMEWIDGET_H
#define GAMEWIDGET_H
#include <QWidget>
#include "referee.h"
#include <QMenuBar>
#include <QMenu>
#include <QAction>
#include <QVBoxLayout>
namespace Ui {
class GameWidget;
}
class GameWidget : public QWidget
{
Q_OBJECT
public:
explicit GameWidget(QWidget *parent = nullptr);
~GameWidget();
Referee* referee = new Referee;
QMenuBar* menubar;
// hint弹窗
HintWidget* h;
signals:
void display(int num);
void showGameSignal(int number);
void showWelcomeSignal(int number);
private:
Ui::GameWidget *ui;
int clickPosRow, clickPosCol; // 存储将点击的位置
protected:
// 绘制
void paintEvent(QPaintEvent *event);
// 监听鼠标移动情况,方便落子
void mouseMoveEvent(QMouseEvent *event);
// 实际落子
void mouseReleaseEvent(QMouseEvent *event);
public slots:
void startUpdate();
void initGame();
void initReplay();
// 显示About信息
void showAboutWidget();
private slots:
void on_RestartPushButton_clicked();
void on_PausePushButton_clicked();
void on_ReactPushButton_clicked();
void on_HintPushButton_clicked();
void on_ReturnPushButton_clicked();
void displayHint(int number);
};
#endif // GAMEWIDGET_H