3#include <QGraphicsRectItem>
4#include <QGraphicsScene>
5#include <QGraphicsView>
6#include <QJsonValueConstRef>
25 Type = Types::DRAGGABLE
35 DraggableItem(
const QString&
id, std::shared_ptr<NodeConfig>
config, QGraphicsItem* parent =
nullptr);
47 int type()
const override;
61 void startDrag(QGraphicsSceneMouseEvent* event);
75 QPainterPath
shape()
const override;
84 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* style, QWidget* widget)
override;
void startDrag(QGraphicsSceneMouseEvent *event)
Starts a drag operation based on the given mouse event.
Definition draggable.cpp:64
QPainterPath shape() const override
Returns the shape of this item for collision detection.
Definition draggable.cpp:53
DraggableItem(const QString &id, std::shared_ptr< NodeConfig > config, QGraphicsItem *parent=nullptr)
Constructs a new DraggableItem with the given ID, configuration, and parent.
Definition draggable.cpp:17
QRectF nodeRect() const override
Returns the bounding rectangle of this item.
Definition draggable.cpp:39
void adjustWidth(int width)
Adjusts the width of the item.
Definition draggable.cpp:58
void handleClick(QGraphicsSceneMouseEvent *event)
Handles a click event based on the given mouse event.
Definition draggable.cpp:103
void paint(QPainter *painter, const QStyleOptionGraphicsItem *style, QWidget *widget) override
Paints this item using the given painter and style options.
Definition draggable.cpp:44
int type() const override
Returns the type of this item.
Definition draggable.cpp:34
virtual std::shared_ptr< NodeConfig > config() const
Retrieves the configuration settings for the node.
Definition node_base.cpp:57
NodeBase(const QString &id, const QString &nodeId, std::shared_ptr< NodeConfig > config, QGraphicsItem *parent)
Constructs a new NodeBase instance.
Definition node_base.cpp:19