ui: graph view edges

Added simple edges to the graph view. Also fixed a memory leak source in QtMainWindow.

fortune cookie message = Good health will be with you.
This commit is contained in:
Manuel Dobusch
2014-07-04 14:11:09 +02:00
parent b1023ba4ac
commit 610aa2eb09
15 changed files with 290 additions and 23 deletions
@@ -7,6 +7,8 @@
#include "component/view/graphElements/GraphNode.h"
class QtGraphEdge;
class QtGraphNode:
public GraphNode,
public QGraphicsRectItem
@@ -15,8 +17,23 @@ public:
QtGraphNode(const Vec2i& position, const std::string& name);
virtual ~QtGraphNode();
virtual Vec2i getPosition();
virtual void addOutEdge(const std::shared_ptr<GraphEdge>& edge);
virtual void addInEdge(const std::weak_ptr<GraphEdge>& edge);
virtual void removeOutEdge(const std::shared_ptr<GraphEdge>& edge);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
private:
QGraphicsTextItem* m_text;
std::list<std::shared_ptr<GraphEdge> > m_outEdges;
std::list<std::weak_ptr<GraphEdge> > m_inEdges;
Vec2i m_mouseOffset;
};
#endif // QT_GRAPH_NODE_H