-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidget.h
52 lines (42 loc) · 954 Bytes
/
widget.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
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include "target.h"
#include "bullet.h"
#include "customescene.h"
#include "shooter.h"
#include "objvec.h"
namespace Ui {
class Widget;
}
class Widget : public QWidget
{
Q_OBJECT
public:
explicit Widget(QString user = "User", int record = 0 , QWidget *parent = 0);
~Widget();
private:
Ui::Widget *ui;
CustomeScene *scene;
Shooter * shooter;
QTimer *timerTarget;
// QList<QGraphicsItem *> targets;
ObjVec<QGraphicsItem *> targets;
int scores_;
QString user_;
int record;
signals:
void stopSignal();
public slots:
void slotHitTarget(QGraphicsItem *item);
void slotScore();
void slotDie();
private slots:
void slotCreateTarget();
void slotBullet(QPointF start, QPointF end, Target *shooter);
void on_stop_clicked();
void on_start_clicked();
};
#endif // WIDGET_H