ui: graph edges clickable

The graph views edges are now clickable. On click the edge and its connected nodes will be displayed.

fortune cookie message = Be prepared to accept an exciting opportunity in the future.
This commit is contained in:
Manuel Dobusch
2014-07-17 12:19:28 +02:00
parent 2c9c83d003
commit 7157f0d127
11 changed files with 228 additions and 88 deletions
+5 -1
View File
@@ -24,6 +24,7 @@ QtGraphView::QtGraphView(ViewLayout* viewLayout)
m_edgeColors.push_back(Vec4i(73, 155, 222, 255)); // type
m_edgeColors.push_back(Vec4i(231, 65, 65, 255)); // return
m_edgeColors.push_back(Vec4i(227, 180, 68, 255)); // parameter
m_edgeColors.push_back(Vec4i(113, 96, 191, 255)); // inheritance
}
QtGraphView::~QtGraphView()
@@ -240,7 +241,7 @@ std::shared_ptr<QtGraphEdge> QtGraphView::createEdge(QGraphicsView* view, const
if(owner != NULL && target != NULL)
{
std::shared_ptr<QtGraphEdge> qtEdge = std::make_shared<QtGraphEdge>(owner, target);
std::shared_ptr<QtGraphEdge> qtEdge = std::make_shared<QtGraphEdge>(owner, target, edge.tokenId);
switch(edge.edgeType)
{
@@ -259,6 +260,9 @@ std::shared_ptr<QtGraphEdge> QtGraphView::createEdge(QGraphicsView* view, const
case Edge::EdgeType::EDGE_PARAMETER_TYPE_OF:
qtEdge->setColor(m_edgeColors[4]);
break;
case Edge::EdgeType::EDGE_INHERITANCE:
qtEdge->setColor(m_edgeColors[5]);
break;
default:
qtEdge->setColor(Vec4i(0, 0, 0, 255));
}