summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics/rbmovable.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/graphics/rbmovable.h')
-rw-r--r--utils/themeeditor/graphics/rbmovable.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/utils/themeeditor/graphics/rbmovable.h b/utils/themeeditor/graphics/rbmovable.h
index 5b6330228d..b4ade98f0c 100644
--- a/utils/themeeditor/graphics/rbmovable.h
+++ b/utils/themeeditor/graphics/rbmovable.h
@@ -42,15 +42,41 @@ public:
42 virtual void paint(QPainter *painter, 42 virtual void paint(QPainter *painter,
43 const QStyleOptionGraphicsItem *option, QWidget *widget); 43 const QStyleOptionGraphicsItem *option, QWidget *widget);
44 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); 44 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
45 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
45 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 46 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
46 47
48 virtual QRectF boundingRect() const{ return size; }
49
47protected: 50protected:
48 virtual QVariant itemChange(GraphicsItemChange change, 51 virtual QVariant itemChange(GraphicsItemChange change,
49 const QVariant &value); 52 const QVariant &value);
50 /* Responsible for updating the parse tree */ 53 /* Responsible for updating the parse tree */
51 virtual void saveGeometry() = 0; 54 virtual void saveGeometry() = 0;
52 55
53 bool geomChanged; 56 QRectF size;
57
58private:
59 static const double handleSize;
60
61 QRectF topLeftHandle();
62 QRectF topRightHandle();
63 QRectF bottomLeftHandle();
64 QRectF bottomRightHandle();
65
66 enum{
67 None,
68 TopLeft,
69 TopRight,
70 BottomLeft,
71 BottomRight
72 } dragMode;
73 QPointF dragStartPos;
74 QRectF dragStartSize;
75 QPointF dragStartClick;
76 double dHeightMin;
77 double dHeightMax;
78 double dWidthMin;
79 double dWidthMax;
54 80
55}; 81};
56 82