forked from gavrus/SampleMaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resizer.hpp
41 lines (31 loc) · 940 Bytes
/
resizer.hpp
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
#ifndef RESIZER_HPP
#define RESIZER_HPP
#include <QObject>
#include <QGraphicsItem>
#include <QtGui>
#include <defines.hpp>
class Resizer : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
explicit Resizer(QGraphicsItem *crop, Position pos);
qreal width;
qreal height;
Position position;
QColor ColorBase;
QColor ColorAnchored;
QColor ColorMousePressed;
bool anchored;
bool pressed;
virtual void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget);
virtual QRectF boundingRect() const;
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void updatePosition();
signals:
void sizeChanged(qreal, qreal, Position);
};
#endif // RESIZER_HPP