-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustomescene.h
More file actions
30 lines (24 loc) · 866 Bytes
/
customescene.h
File metadata and controls
30 lines (24 loc) · 866 Bytes
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
#ifndef CUSTOMESCENE_H
#define CUSTOMESCENE_H
#include <QObject>
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
class CustomeScene: public QGraphicsScene
{
Q_OBJECT
public:
explicit CustomeScene(QObject *parent = 0);
~CustomeScene();
signals:
// Сигнал для передачи координат положения курсора мыши
void signalTargetCoordinate(QPointF point);
void signalShot(bool shot); // Сигнал на стрельбу
public slots:
private:
// Функция, в которой производится отслеживание положения мыши
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
};
#endif // CUSTOMESCENE_H