1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef STATEMACHINEEXTENDED_P_H |
5 | #define STATEMACHINEEXTENDED_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include "qscxmlqmlglobals_p.h" |
19 | |
20 | #include <QtScxml/qscxmlstatemachine.h> |
21 | #include <QtCore/qobject.h> |
22 | #include <QtQml/qqmllist.h> |
23 | #include <QtQml/qqml.h> |
24 | |
25 | QT_BEGIN_NAMESPACE |
26 | |
27 | /* Allow State Machines created from QML to have children. */ |
28 | class Q_SCXMLQML_PRIVATE_EXPORT QScxmlStateMachineExtended : public QObject |
29 | { |
30 | Q_OBJECT |
31 | Q_PROPERTY(QQmlListProperty<QObject> children READ children) |
32 | Q_CLASSINFO("DefaultProperty" , "children" ) |
33 | public: |
34 | QScxmlStateMachineExtended(QObject *extendee); |
35 | QQmlListProperty<QObject> children(); |
36 | |
37 | private: |
38 | QObjectList m_children; |
39 | }; |
40 | |
41 | // The QScxmlStateMachine is defined in the scxml library |
42 | struct Q_SCXMLQML_PRIVATE_EXPORT QScxmlStateMachineForeign |
43 | { |
44 | Q_GADGET |
45 | QML_UNCREATABLE("Only created through derived types" ) |
46 | QML_NAMED_ELEMENT(StateMachine) |
47 | QML_FOREIGN(QScxmlStateMachine) |
48 | QML_EXTENDED(QScxmlStateMachineExtended) |
49 | QML_ADDED_IN_VERSION(5,8) |
50 | }; |
51 | |
52 | QT_END_NAMESPACE |
53 | |
54 | #endif // STATEMACHINEEXTENDED_P_H |
55 | |