Diagram editor: users may now enter visualisation mode by pressing Ctrl and Shift.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1593 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-03-24 14:34:25 +00:00
parent 7370edbb4e
commit 245a8abbb1
2 changed files with 117 additions and 13 deletions

View File

@@ -47,6 +47,8 @@ class DiagramView : public QGraphicsView {
QAction *find_element_;
QPoint paste_here_pos;
bool is_adding_text;
bool is_moving_view_; ///< Indicate whether the visualisation mode has been enabled due to mouse/keyboard interactions
bool fresh_focus_in_; ///< Indicate the focus was freshly gained
ElementsLocation next_location_;
QPoint next_position_;
@@ -71,7 +73,14 @@ class DiagramView : public QGraphicsView {
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void contextMenuEvent(QContextMenuEvent *);
virtual void wheelEvent(QWheelEvent *);
virtual void focusInEvent(QFocusEvent *);
virtual void keyPressEvent(QKeyEvent *);
virtual void keyReleaseEvent(QKeyEvent *);
virtual bool event(QEvent *);
virtual bool switchToVisualisationModeIfNeeded(QInputEvent *e);
virtual bool switchToSelectionModeIfNeeded(QInputEvent *e);
virtual bool isCtrlShifting(QInputEvent *);
virtual bool selectedItemHasFocus();
private:
void mousePressEvent(QMouseEvent *);