summaryrefslogtreecommitdiffstats
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:
virtual void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget);
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ virtual QRectF boundingRect() const{ return size; }
+
protected:
virtual QVariant itemChange(GraphicsItemChange change,
const QVariant &value);
/* Responsible for updating the parse tree */
virtual void saveGeometry() = 0;
- bool geomChanged;
+ QRectF size;
+
+private:
+ static const double handleSize;
+
+ QRectF topLeftHandle();
+ QRectF topRightHandle();
+ QRectF bottomLeftHandle();
+ QRectF bottomRightHandle();
+
+ enum{
+ None,
+ TopLeft,
+ TopRight,
+ BottomLeft,
+ BottomRight
+ } dragMode;
+ QPointF dragStartPos;
+ QRectF dragStartSize;
+ QPointF dragStartClick;
+ double dHeightMin;
+ double dHeightMax;
+ double dWidthMin;
+ double dWidthMax;
};