-
Notifications
You must be signed in to change notification settings - Fork 3
/
PolyDot.h
35 lines (28 loc) · 860 Bytes
/
PolyDot.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
#ifndef POLYDOT_H
#define POLYDOT_H
#include <QtGui>
class PolyDot : public QObject,public QGraphicsItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
public:
PolyDot();
QRectF boundingRect() const;
QRectF markerRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPointF center();
signals:
void dotMoved();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
private:
bool dispRect;
bool dispLabel;
QGraphicsItem *parentPolygon;
};
#endif // POLYDOT_H