feat: add node edges

This commit is contained in:
parker
2025-06-20 23:12:09 +01:00
parent cf876320d8
commit 20c6ad2b64
10 changed files with 211 additions and 28 deletions

View File

@@ -0,0 +1,27 @@
#include "gui/network/NodeEdgeGraphic.h"
#include <QTextDocument>
#include "gui/network/SocketGraphic.h"
#include <iostream>
#include <qgraphicsitem.h>
NodeEdgeGraphic::NodeEdgeGraphic(SocketGraphic* socket1, SocketGraphic* socket2, QGraphicsItem *parent)
: QGraphicsItem(parent), socket1_{socket1}, socket2_{socket2}
{
setZValue(-1);
}
QRectF NodeEdgeGraphic::boundingRect() const
{
auto boundRect = QRect(10,10,10,10);
return boundRect;
}
void NodeEdgeGraphic::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter->setPen(QPen("white"));
std::cout << "drawing " << socket1_->scenePos().x() << " " << socket1_->scenePos().y() << "\n";
painter->drawLine(socket1_->scenePos(),socket2_->scenePos());
}