QScxmlDataModel Class

The QScxmlDataModel class is the data model base class for a Qt SCXML state machine. More...

Header: #include <QScxmlDataModel>
qmake: QT += scxml
Since: Qt 5.7
Inherits: QObject
Inherited By:

QScxmlCppDataModel, QScxmlEcmaScriptDataModel, and QScxmlNullDataModel

Public Types

Properties

  • 1 property inherited from QObject

Public Functions

QScxmlDataModel(QObject *parent = nullptr)
virtual void evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) = 0
virtual void evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, QScxmlDataModel::ForeachLoopBody *body) = 0
virtual void evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) = 0
virtual bool evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) = 0
virtual QString evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) = 0
virtual QVariant evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) = 0
virtual void evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) = 0
virtual bool hasScxmlProperty(const QString &name) const = 0
virtual QVariant scxmlProperty(const QString &name) const = 0
virtual void setScxmlEvent(const QScxmlEvent &event) = 0
virtual bool setScxmlProperty(const QString &name, const QVariant &value, const QString &context) = 0
void setStateMachine(QScxmlStateMachine *stateMachine)
virtual bool setup(const QVariantMap &initialDataValues) = 0
QScxmlStateMachine *stateMachine() const
  • 31 public functions inherited from QObject

Signals

void stateMachineChanged(QScxmlStateMachine *stateMachine)

Static Public Members

const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject

Protected Functions

QScxmlDataModel(QScxmlDataModelPrivate &dd, QObject *parent = nullptr)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject

Detailed Description

The QScxmlDataModel class is the data model base class for a Qt SCXML state machine.

SCXML data models are described in SCXML Specification - 5 Data Model and Data Manipulation. For more information about supported data models, see SCXML Compliance.

One data model can only belong to one state machine.

See also QScxmlStateMachine, QScxmlCppDataModel, QScxmlEcmaScriptDataModel, and QScxmlNullDataModel.

Property Documentation

stateMachine : QScxmlStateMachine*

This property holds the state machine this data model belongs to.

A data model can only belong to a single state machine and a state machine can only have one data model. This relation needs to be set up before the state machine is started. Setting this property on a data model will automatically set the corresponding dataModel property on the stateMachine.

Access functions:

QScxmlStateMachine *stateMachine() const
void setStateMachine(QScxmlStateMachine *stateMachine)

Notifier signal:

void stateMachineChanged(QScxmlStateMachine *stateMachine)

Member Function Documentation

QScxmlDataModel::QScxmlDataModel(QObject *parent = nullptr)

Creates a new data model, with the parent object parent.

[protected] QScxmlDataModel::QScxmlDataModel(QScxmlDataModelPrivate &dd, QObject *parent = nullptr)

Creates a new data model from the private object dd, with the parent object parent.

[pure virtual] void QScxmlDataModel::evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok)

[pure virtual] void QScxmlDataModel::evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, QScxmlDataModel::ForeachLoopBody *body)

[pure virtual] void QScxmlDataModel::evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok)

[pure virtual] bool QScxmlDataModel::evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok)

[pure virtual] QString QScxmlDataModel::evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok)

[pure virtual] QVariant QScxmlDataModel::evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok)

[pure virtual] void QScxmlDataModel::evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok)

[pure virtual] bool QScxmlDataModel::hasScxmlProperty(const QString &name) const

[pure virtual] QVariant QScxmlDataModel::scxmlProperty(const QString &name) const

See also setScxmlProperty().

[pure virtual] void QScxmlDataModel::setScxmlEvent(const QScxmlEvent &event)

[pure virtual] bool QScxmlDataModel::setScxmlProperty(const QString &name, const QVariant &value, const QString &context)

See also scxmlProperty().

void QScxmlDataModel::setStateMachine(QScxmlStateMachine *stateMachine)

Sets the state machine this model belongs to to stateMachine. There is a 1:1 relation between state machines and models. After setting the state machine once you cannot change it anymore. Any further attempts to set the state machine using this method will be ignored.

Note: Setter function for property stateMachine.

See also stateMachine().

[pure virtual] bool QScxmlDataModel::setup(const QVariantMap &initialDataValues)

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

QScxmlStateMachine *QScxmlDataModel::stateMachine() const

Returns the state machine associated with the data model.

Note: Getter function for property stateMachine.

See also setStateMachine().