statemachine.h Example File
trafficlight-qml-simple/statemachine.h// // Statemachine code from reading SCXML file 'statemachine.scxml' // Created by: The Qt SCXML Compiler version 1 (Qt 5.12.6) // WARNING! All changes made in this file will be lost! // #ifndef STATEMACHINE_H #define STATEMACHINE_H #include <QScxmlStateMachine> #include <QString> #include <QVariant> class TrafficLightStateMachine: public QScxmlStateMachine { /* qmake ignore Q_OBJECT */ Q_OBJECT Q_PROPERTY(bool working) Q_PROPERTY(bool red) Q_PROPERTY(bool yellow) Q_PROPERTY(bool redGoingGreen) Q_PROPERTY(bool greenGoingRed) Q_PROPERTY(bool green) Q_PROPERTY(bool broken) Q_PROPERTY(bool blinking) Q_PROPERTY(bool unblinking) public: Q_INVOKABLE TrafficLightStateMachine(QObject *parent = 0); ~TrafficLightStateMachine(); Q_SIGNALS: private: struct Data; friend struct Data; struct Data *data; }; Q_DECLARE_METATYPE(::TrafficLightStateMachine*) #endif // STATEMACHINE_H