-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
80 lines (74 loc) · 1.76 KB
/
mainwindow.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QLabel>
#include <QTextEdit>
#include <QPushButton>
#include <QWidget>
#include <iostream>
#include <QTime>
#include <QLineEdit>
#include <QPushButton>
#include <QPainter>
#include <QMessageBox>
#include <QDebug>
#include <QKeyEvent>
#include <QPixmap>
#include <QMenuBar>
#include <QMenu>
#include "Game.h"
#include <QThread>
#include <QMutex>
#include <QMutexLocker>
#include <QMediaPlayer>
#include <QMediaPlaylist>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
void paintEvent(QPaintEvent *);
void keyPressEvent(QKeyEvent *e);
void mousePressEvent(QMouseEvent *event);
~MainWindow();
friend class Game;
private:
QPixmap wallPixmap;
QPixmap aimPixmap;
QPixmap manPixmap;
QPixmap manOnAimPixmap;
QPixmap boxPixmap;
QPixmap boxOnAimPixmap;
QLabel *roundLabel;
QLabel *stepLabel;
QPushButton *nextBtn;
QPushButton *restartBtn;
QPushButton *preBtn;
QPushButton *goBackBtn;
QMenu *menu;
QMutex mutex;
int round;
int cnt;
int timerId;
vector<int> showAns;
vector<int>::iterator showAnsIt;
Game *game;
void checkGame();
bool loadGame();
bool loadGame(QString filename, QString);
void nextStep();
void preStep();
QDialog dlg ;
QMediaPlayer player;
QMediaPlaylist *myplaylist;
QMediaPlayer *myplayer;
private slots:
void onNextBtnClicked();
void onRestartBtnClicked();
void onPreBtnClicked();
void onActionClicked();
void showHelpInformation();
void showAboutInformation();
void onGoBackBtnClicked();
};
#endif // MAINWINDOW_H