forked from cyberintruder/DGIPyDrOneQt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
joystickrect.h
34 lines (25 loc) · 847 Bytes
/
joystickrect.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
#ifndef JOYSTICKRECT_H
#define JOYSTICKRECT_H
#include "remotecontroller.h"
#include <QGraphicsItem>
#include <QRectF>
#include <QPainter>
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
class joystickRect : public QGraphicsItem
{
public:
joystickRect(remoteController * controllerJ);
QRectF boundingRect() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget) Q_DECL_OVERRIDE;
void setPosDirect(qreal x, qreal y);
QPointF _location;
private:
virtual void mouseMoveEvent ( QGraphicsSceneMouseEvent * event );
virtual void mousePressEvent (QGraphicsSceneMouseEvent * event );
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent * event );
QPointF _dragStart;
remoteController *controller;
};
#endif // JOYSTICKRECT_H