fix: functional node deletion

This commit is contained in:
parker
2025-08-16 01:34:13 +01:00
parent 8370080e35
commit efc21cd628
8 changed files with 75 additions and 16 deletions

View File

@@ -1,14 +1,16 @@
#pragma once
#include <QGraphicsItem>
#include "Gui/Network/SocketGraphic.h"
#include "Engine/Operator/GeometryConnection.h"
#include <QPainter>
#include <memory>
class NodeEdgeGraphic
: public QGraphicsItem
{
public:
NodeEdgeGraphic(SocketGraphic* socket1, SocketGraphic* socket2, QGraphicsItem *parent = nullptr);
NodeEdgeGraphic(SocketGraphic* socket1, SocketGraphic* socket2, std::weak_ptr<enzo::nt::GeometryConnection> connection, QGraphicsItem *parent = nullptr);
~NodeEdgeGraphic();
QRectF boundingRect() const override;
@@ -20,7 +22,7 @@ public:
void setPos(QPointF pos1, QPointF pos2);
void setStartPos(QPointF pos);
void setEndPos(QPointF pos);
void cleanUp();
void remove();
void setDeleteHighlight(bool state);
QPen deleteHighlightPen_;
QPen defaultPen_;
@@ -41,6 +43,8 @@ private:
qreal padding_=40;
QPointF hoverPos_;
std::weak_ptr<enzo::nt::GeometryConnection> connection_;
void updatePath();
protected:
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;