feat: connect nodes

This commit is contained in:
parker
2025-06-21 03:00:38 +01:00
parent a6a0bec1c0
commit 38508293ff
6 changed files with 59 additions and 14 deletions

View File

@@ -6,16 +6,24 @@ class SocketGraphic
: public QGraphicsItem
{
public:
SocketGraphic(QGraphicsItem *parent = nullptr);
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
enum class SocketType {
Input,
Output
};
SocketGraphic(SocketGraphic::SocketType type, QGraphicsItem *parent = nullptr);
SocketType getIO();
private:
int socketSize_ = 1;
QBrush brushInactive_;
QBrush brushActive_;
bool hovered_=false;
SocketType type_;
protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;