3#include <QGraphicsRectItem>
4#include <QGraphicsScene>
5#include <QGraphicsView>
6#include <QJsonValueConstRef>
25 Type = Types::DRAGGABLE
35 DraggableItem(
const QString& instanceId,
const QString&
nodeId, std::shared_ptr<NodeConfig>
config, QGraphicsItem* parent =
nullptr);
47 int type()
const override;
61 Qt::DropAction
startDrag(QGraphicsSceneMouseEvent* event);
75 QPainterPath
shape()
const override;
84 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* style, QWidget* widget)
override;
Qt::DropAction startDrag(QGraphicsSceneMouseEvent *event)
Starts a drag operation based on the given mouse event.
Definition draggable.cpp:80
QPainterPath shape() const override
Returns the shape of this item for collision detection.
Definition draggable.cpp:69
DraggableItem(const QString &instanceId, const QString &nodeId, std::shared_ptr< NodeConfig > config, QGraphicsItem *parent=nullptr)
Constructs a new DraggableItem with the given ID, configuration, and parent.
Definition draggable.cpp:16
QRectF nodeRect() const override
Returns the bounding rectangle of this item.
Definition draggable.cpp:32
void adjustWidth(int width)
Adjusts the width of the item.
Definition draggable.cpp:74
void handleClick(QGraphicsSceneMouseEvent *event)
Handles a click event based on the given mouse event.
Definition draggable.cpp:117
void paint(QPainter *painter, const QStyleOptionGraphicsItem *style, QWidget *widget) override
Paints this item using the given painter and style options.
Definition draggable.cpp:37
int type() const override
Returns the type of this item.
Definition draggable.cpp:27
virtual QString nodeId() const
Retrieves the identifier of the node within its type.
Definition node_base.cpp:49
std::shared_ptr< NodeConfig > config() const
Retrieves the configuration settings for the node.
Definition node_base.cpp:54
NodeBase(const QString &id, const QString &nodeId, std::shared_ptr< NodeConfig > config, QGraphicsItem *parent)
Constructs a new NodeBase instance.
Definition node_base.cpp:16