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);
21 virtual void keyPressEvent(QKeyEvent * keyEvent);
22 virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
23 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
24 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e);
25 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
26 virtual void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
29 void setCursor(QCursor);
31 QGraphicsItem* m_selectedItem;
32 resizeModes resizeMode;
39 void newRect(QGraphicsRectItem *);
40 void newText(QGraphicsTextItem *);
41 void actionFinished();