1 #ifndef GRAPHICSVIEWRECTMOVE_H
2 #define GRAPHICSVIEWRECTMOVE_H
4 #include <QGraphicsScene>
6 enum resizeModes {NoResize, TopLeft, BottomLeft, TopRight, BottomRight, Left, Right, Up, Down};
7 enum TITLETOOL { TITLE_SELECT = 0, TITLE_RECTANGLE = 1, TITLE_TEXT = 2, TITLE_IMAGE = 3 };
9 class GraphicsSceneRectMove: public QGraphicsScene {
12 GraphicsSceneRectMove(QObject* parent = 0);
14 void setSelectedItem(QGraphicsItem *item);
15 void setScale(double s);
16 void setZoom(double s);
17 void setTool(TITLETOOL tool);
19 void clearTextSelection();
22 virtual void keyPressEvent(QKeyEvent * keyEvent);
23 virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
24 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
25 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e);
26 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
27 virtual void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
30 void setCursor(QCursor);
32 QGraphicsItem* m_selectedItem;
33 resizeModes resizeMode;
34 QPointF m_sceneClickPoint;
41 void newRect(QGraphicsRectItem *);
42 void newText(QGraphicsTextItem *);
43 void actionFinished();