3#include <QGraphicsLineItem>
4#include <QGraphicsPathItem>
49 int type()
const override;
57 void setStart(
const QString&
id,
const QPointF& point,
const QPointF& controlShift);
65 void setEnd(
const QString&
id,
const QPointF& point,
const QPointF& controlShift);
91 void move(
const QString&
id, QPointF pos);
96 void updatePath(QPainterPath painterPath = {});
104 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option, QWidget* widget)
override;
110 QPainterPath
shape()
const override;
116 TransitionSaveInfo
saveInfo()
const;
122 std::shared_ptr<TransitionSaveInfo>
storage()
const;
134 void setName(
const QString& name);
Represents a graphical node item in a flowchart.
Definition node.h:26
Represents a transition between two nodes in a graphical representation.
Definition transition.h:15
void setEvent(const QString &name)
Sets the event associated with this transition.
Definition transition.cpp:235
void move(const QString &id, QPointF pos)
Moves the transition to a new position.
Definition transition.cpp:91
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:160
void updateLabelPosition()
Shared pointer to the storage information.
Definition transition.cpp:202
std::function< void(TransitionItem *item)> transitionModified
Signal emitted when the transition is deleted.
Definition transition.h:156
NodeItem * source() const
Retrieves the source node of this transition.
Definition transition.cpp:81
std::shared_ptr< TransitionSaveInfo > mStorage
Pointer to the label text item.
Definition transition.h:168
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:162
void setName(const QString &name)
Sets the name of this transition.
Definition transition.cpp:197
QString getName() const
Retrieves the name of this transition.
Definition transition.cpp:189
NodeItem * mSource
Type of edge used in the transition.
Definition transition.h:164
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:112
void setStart(const QString &id, const QPointF &point, const QPointF &controlShift)
Sets the start point and control shift for the transition.
Definition transition.cpp:51
NodeItem * mDestination
Pointer to the source node item.
Definition transition.h:165
const QString mId
Signal emitted when the transition is modified.
Definition transition.h:159
QGraphicsTextItem * mLabel
Pointer to the destination node item.
Definition transition.h:167
void done(NodeItem *source, NodeItem *destination)
Completes the transition by setting source and destination nodes.
Definition transition.cpp:65
void setEdge(Edge edge)
Sets the type of edge for this transition.
Definition transition.cpp:76
Edge
Enumerates the types of edges that can be used for transitions.
Definition transition.h:21
int type() const override
Retrieves the type of this graphics item.
Definition transition.cpp:46
void setEnd(const QString &id, const QPointF &point, const QPointF &controlShift)
Sets the end point and control shift for the transition.
Definition transition.cpp:58
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:230
NodeItem * destination() const
Retrieves the destination node of this transition.
Definition transition.cpp:86
Represents transition save information.
Definition transition_info.h:14