ui: Added show definition context menu action for graph nodes (issue #83)

* use 'show definition' context menu action or 'Ctrl/Cmd + Left Click' to show definition of node in code
This commit is contained in:
Eberhard Graether
2018-07-22 14:30:56 +02:00
parent 0b5ad33a8c
commit ad6f5c8727
16 changed files with 267 additions and 53 deletions
@@ -11,6 +11,7 @@
#include "qt/utility/utilityQt.h"
#include "qt/view/graphElements/nodeComponents/QtGraphNodeComponent.h"
#include "qt/view/graphElements/QtGraphEdge.h"
#include "utility/messaging/type/code/MessageCodeShowDefinition.h"
#include "utility/messaging/type/MessageGraphNodeHide.h"
#include "utility/messaging/type/MessageGraphNodeMove.h"
#include "utility/ResourcePaths.h"
@@ -400,6 +401,20 @@ void QtGraphNode::onHide()
}
}
void QtGraphNode::onShowDefinition()
{
Id tokenId = getTokenId();
if (tokenId)
{
MessageCodeShowDefinition(tokenId).dispatch();
}
else if (getParent())
{
getParent()->onShowDefinition();
}
}
void QtGraphNode::mousePressEvent(QGraphicsSceneMouseEvent* event)
{
event->ignore();