The primitive decorator now handles keyboard-driven movements.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2028 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2013-02-08 22:05:18 +00:00
parent 2bed00fd25
commit 1ba32a5b27
6 changed files with 60 additions and 61 deletions

View File

@@ -47,6 +47,8 @@ class ElementPrimitiveDecorator : public QGraphicsObject {
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *);
void mouseMoveEvent(QGraphicsSceneMouseEvent *);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
void keyPressEvent(QKeyEvent *);
void keyReleaseEvent(QKeyEvent *);
QPointF snapConstPointToGrid(const QPointF &) const;
void snapPointToGrid(QPointF &) const;
bool mustSnapToGrid(QGraphicsSceneMouseEvent *);
@@ -85,6 +87,8 @@ class ElementPrimitiveDecorator : public QGraphicsObject {
QPointF first_pos_; ///< First point involved within the current resizing operation
QPointF latest_pos_; ///< Latest point involved within the current resizing operation
QPointF mouse_offset_; ///< Offset between the mouse position and the point to be snapped to grid when moving selection
bool moving_by_keys_; ///< Whether we are currently moving our decorated items using the arrow keys
QPointF keys_movement_; ///< Movement applied to our decorated items using the arrow keys
};
#endif