KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
transition.h
Go to the documentation of this file.
1/*
2 This file is part of the KDAB State Machine Editor Library.
3
4 SPDX-FileCopyrightText: 2014 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: Kevin Funk <kevin.funk@kdab.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LicenseRef-KDAB-KDStateMachineEditor
8
9 Licensees holding valid commercial KDAB State Machine Editor Library
10 licenses may use this file in accordance with the KDAB State Machine Editor
11 Library License Agreement provided with the Software.
12
13 Contact info@kdab.com if any conditions of this licensing are not clear to you.
14*/
15
16#ifndef KDSME_MODEL_TRANSITION_H
17#define KDSME_MODEL_TRANSITION_H
18
19#include "element.h"
20
21namespace KDSME {
22
23class KDSME_CORE_EXPORT Transition : public Element
24{
25 Q_OBJECT
26 Q_PROPERTY(KDSME::State *sourceState READ sourceState WRITE setSourceState NOTIFY sourceStateChanged FINAL)
27 Q_PROPERTY(KDSME::State *targetState READ targetState WRITE setTargetState NOTIFY targetStateChanged FINAL)
28 Q_PROPERTY(QString guard READ guard WRITE setGuard NOTIFY guardChanged FINAL)
30 Q_PROPERTY(QPainterPath shape READ shape WRITE setShape NOTIFY shapeChanged FINAL)
31 Q_PROPERTY(QRectF labelBoundingRect READ labelBoundingRect WRITE setLabelBoundingRect NOTIFY labelBoundingRectChanged FINAL)
32
33public:
34 explicit Transition(State *sourceState = nullptr);
35 ~Transition();
36
37 Q_INVOKABLE KDSME::StateMachine *machine() const;
38
39 State *sourceState() const;
40 void setSourceState(State *sourceState);
41
42 State *targetState() const;
43 void setTargetState(State *targetState);
44
45 Type type() const override;
46
52 QString guard() const;
53 void setGuard(const QString &guard);
54
55 QPainterPath shape() const;
56 void setShape(const QPainterPath &shape);
57
58 QRectF labelBoundingRect() const;
59 void setLabelBoundingRect(const QRectF &rect);
60
61Q_SIGNALS:
62 void sourceStateChanged(KDSME::State *sourceState);
63 void targetStateChanged(KDSME::State *targetState);
64 void guardChanged(const QString &guard);
65 void shapeChanged(const QPainterPath &path);
66 void labelBoundingRectChanged(const QRectF &rect);
67
68private:
69 struct Private;
70 QScopedPointer<Private> d;
71};
72
73KDSME_CORE_EXPORT QDebug operator<<(QDebug dbg, const Transition *transition);
74
75class KDSME_CORE_EXPORT SignalTransition : public Transition
76{
77 Q_OBJECT
78 Q_PROPERTY(QString signal READ signal WRITE setSignal NOTIFY signalChanged)
79
80public:
81 explicit SignalTransition(State *sourceState);
83
84 Type type() const override;
85
86 QString signal() const;
87 void setSignal(const QString &signal);
88
89Q_SIGNALS:
90 void signalChanged(const QString &signal);
91
92private:
93 struct Private;
94 QScopedPointer<Private> d;
95};
96
97class KDSME_CORE_EXPORT TimeoutTransition : public Transition
98{
99 Q_OBJECT
100 Q_PROPERTY(int timeout READ timeout WRITE setTimeout NOTIFY timeoutChanged)
101
102public:
103 explicit TimeoutTransition(State *sourceState);
105
106 Type type() const override;
107
108 int timeout() const;
109 void setTimeout(int timeout);
110
111Q_SIGNALS:
112 void timeoutChanged(int timeout);
113
114private:
115 struct Private;
116 QScopedPointer<Private> d;
117};
118
119}
120
121#endif
void signalChanged(const QString &signal)
void timeoutChanged(int timeout)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8