ui: graph view layouting and member rendering
Added simple layouting functions (implementations for simple grid and circle layout). Also the graph displays class members and connections (edges) to or from them "correctly" now. fortune cookie message = Your exotic ideas will lead you to many exciting new adventures.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include "qt/view/graphElements/QtGraphNodeMouseMovable.h"
|
||||
|
||||
#include "qgraphicssceneevent.h"
|
||||
|
||||
#include "qt/view/graphElements/QtGraphEdge.h"
|
||||
|
||||
QtGraphNodeMouseMovable::QtGraphNodeMouseMovable(const Vec2i& position, const std::string& name, const Id tokenId)
|
||||
: QtGraphNode(position, name, tokenId)
|
||||
{
|
||||
}
|
||||
|
||||
QtGraphNodeMouseMovable::~QtGraphNodeMouseMovable()
|
||||
{
|
||||
}
|
||||
|
||||
void QtGraphNodeMouseMovable::mousePressEvent(QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
m_mouseOffset.x = event->pos().x();
|
||||
m_mouseOffset.y = event->pos().y();
|
||||
}
|
||||
|
||||
void QtGraphNodeMouseMovable::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
this->setPos(event->scenePos().x() - m_mouseOffset.x, event->scenePos().y() - m_mouseOffset.y);
|
||||
|
||||
Vec2i p(event->scenePos().x(), event->scenePos().y());
|
||||
|
||||
notifyEdgesAfterMove();
|
||||
}
|
||||
Reference in New Issue
Block a user