ui: Added more movement controls to the graph

* SHIFT + mouse wheel for zooming
* WASD for moving up, right, left, down
* SHIFT + WS for zooming
* zoom anchor is under the mouse

bug id = 54
This commit is contained in:
Eberhard Graether
2016-03-12 00:55:31 +01:00
parent bcb43eccd0
commit 53d5fe6a06
5 changed files with 190 additions and 53 deletions
+2 -19
View File
@@ -13,26 +13,9 @@ struct DummyNode;
class QMouseEvent;
class QSequentialAnimationGroup;
class QtGraphEdge;
class QtGraphicsView;
class QtGraphNode;
class QtGraphicsView
: public QGraphicsView
{
Q_OBJECT
public:
QtGraphicsView(QWidget* parent);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
signals:
void emptySpaceClicked();
private:
QPoint m_last;
};
class QtGraphView
: public QObject
, public GraphView
@@ -66,7 +49,7 @@ private slots:
private:
void switchToNewGraphData();
QGraphicsView* getView() const;
QtGraphicsView* getView() const;
void doRebuildGraph(std::shared_ptr<Graph> graph, const std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges);
void doClear();