3#include <QGraphicsLineItem>
4#include <QGraphicsPathItem>
50 int type()
const override;
58 void setStart(
const QString&
id,
const QPointF& point,
const QPointF& controlShift,
const Types::Port& port,
const QString& subflow);
66 void setEnd(
const QString&
id,
const QPointF& point,
const QPointF& controlShift,
const Types::Port& port,
const QString& subflow);
92 void move(
const QString&
id, QPointF pos);
97 void updatePath(QPainterPath painterPath = {});
105 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option, QWidget* widget)
override;
111 QPainterPath
shape()
const override;
117 TransitionSaveInfo
saveInfo()
const;
123 std::shared_ptr<TransitionSaveInfo>
storage()
const;
135 void setName(
const QString& name);
155 QPointF sourceAnchor()
const;
156 QPointF destinationAnchor()
const;
Represents a graphical node item in a flowchart.
Definition node.h:28
Represents a transition between two nodes in a graphical representation.
Definition transition.h:16
void setEvent(const QString &name)
Sets the event associated with this transition.
Definition transition.cpp:254
void move(const QString &id, QPointF pos)
Moves the transition to a new position.
Definition transition.cpp:93
QPainterPath shape() const override
Retrieves the shape of this graphics item.
Definition transition.cpp:140
bool mComplete
Unique identifier for this transition.
Definition transition.h:164
void updateLabelPosition()
Shared pointer to the storage information.
Definition transition.cpp:222
std::function< void(TransitionItem *item)> transitionModified
Signal emitted when the transition is deleted.
Definition transition.h:160
NodeItem * source() const
Retrieves the source node of this transition.
Definition transition.cpp:83
std::shared_ptr< TransitionSaveInfo > mStorage
Pointer to the label text item.
Definition transition.h:172
void updatePath(QPainterPath painterPath={})
Updates the path of this transition item.
Definition transition.cpp:157
TransitionItem(std::shared_ptr< TransitionSaveInfo > storage)
Constructs a new TransitionItem with the given storage information.
Definition transition.cpp:12
Edge mEdge
Flag indicating if the transition is complete.
Definition transition.h:166
void setName(const QString &name)
Sets the name of this transition.
Definition transition.cpp:217
QString getName() const
Retrieves the name of this transition.
Definition transition.cpp:209
NodeItem * mSource
Type of edge used in the transition.
Definition transition.h:168
QString id() const
Retrieves the unique identifier of this transition item.
Definition transition.cpp:41
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Paints this graphics item using the given painter.
Definition transition.cpp:115
NodeItem * mDestination
Pointer to the source node item.
Definition transition.h:169
const QString mId
Signal emitted when the transition is modified.
Definition transition.h:163
QGraphicsTextItem * mLabel
Pointer to the destination node item.
Definition transition.h:171
void done(NodeItem *source, NodeItem *destination)
Completes the transition by setting source and destination nodes.
Definition transition.cpp:69
void setEdge(Edge edge)
Sets the type of edge for this transition.
Definition transition.cpp:78
Edge
Enumerates the types of edges that can be used for transitions.
Definition transition.h:22
int type() const override
Retrieves the type of this graphics item.
Definition transition.cpp:46
void setStart(const QString &id, const QPointF &point, const QPointF &controlShift, const Types::Port &port, const QString &subflow)
Sets the start point and control shift for the transition.
Definition transition.cpp:51
void setEnd(const QString &id, const QPointF &point, const QPointF &controlShift, const Types::Port &port, const QString &subflow)
Sets the end point and control shift for the transition.
Definition transition.cpp:60
std::shared_ptr< TransitionSaveInfo > storage() const
Retrieves the shared pointer to the storage information.
Definition transition.cpp:147
TransitionSaveInfo saveInfo() const
Retrieves the save information for this transition.
Definition transition.cpp:152
QString getEvent() const
Retrieves the event associated with this transition.
Definition transition.cpp:249
NodeItem * destination() const
Retrieves the destination node of this transition.
Definition transition.cpp:88
Represents transition save information.
Definition transition_info.h:14