QScxmlNullDataModel Class
The QScxmlNullDataModel class is the null data model for a Qt SCXML stateMachine. More...
Header: | #include <QScxmlNullDataModel> |
qmake: | QT += scxml |
Since: | Qt 5.7 |
Inherits: | QScxmlDataModel |
Public Functions
QScxmlNullDataModel(QObject *parent = nullptr) | |
virtual | ~QScxmlNullDataModel() |
Reimplemented Public Functions
virtual void | evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) override |
virtual void | evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, QScxmlDataModel::ForeachLoopBody *body) override |
virtual void | evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) override |
virtual bool | evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) override |
virtual QString | evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) override |
virtual QVariant | evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) override |
virtual void | evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) override |
virtual bool | hasScxmlProperty(const QString &name) const override |
virtual QVariant | scxmlProperty(const QString &name) const override |
virtual void | setScxmlEvent(const QScxmlEvent &event) override |
virtual bool | setScxmlProperty(const QString &name, const QVariant &value, const QString &context) override |
virtual bool | setup(const QVariantMap &initialDataValues) override |
- 14 public functions inherited from QScxmlDataModel
- 31 public functions inherited from QObject
Static Public Members
const QMetaObject | staticMetaObject |
- 9 static public members inherited from QObject
Additional Inherited Members
- 1 property inherited from QScxmlDataModel
- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 1 signal inherited from QScxmlDataModel
- 2 signals inherited from QObject
- 9 protected functions inherited from QObject
Detailed Description
The QScxmlNullDataModel class is the null data model for a Qt SCXML stateMachine.
This class implements the null data model as described in the SCXML Specification - B.1 The Null Data Model. Using the value "null"
for the datamodel attribute of the <scxml>
element means that there is no underlying data model, but some executable content, like In(...)
or <log>
can still be used.
See also QScxmlStateMachine and QScxmlDataModel.
Member Function Documentation
QScxmlNullDataModel::QScxmlNullDataModel(QObject *parent = nullptr)
Creates a new Qt SCXML null data model, with the parent object parent.
[virtual]
QScxmlNullDataModel::~QScxmlNullDataModel()
Destroys the data model.
[override virtual]
void QScxmlNullDataModel::evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok)
Reimplemented from QScxmlDataModel::evaluateAssignment().
Throws an error and sets ok to false
, because the null data model cannot evaluate assignments.
[override virtual]
void QScxmlNullDataModel::evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, QScxmlDataModel::ForeachLoopBody *body)
Reimplemented from QScxmlDataModel::evaluateForeach().
Throws an error and sets ok to false
, because the null data model cannot evaluate <foreach>
blocks.
[override virtual]
void QScxmlNullDataModel::evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok)
Reimplemented from QScxmlDataModel::evaluateInitialization().
Throws an error and sets ok to false
, because the null data model cannot initialize data.
[override virtual]
bool QScxmlNullDataModel::evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok)
Reimplemented from QScxmlDataModel::evaluateToBool().
Evaluates the executable content pointed to by id and records in ok whether there was an error. Returns the result of the evaluation as a boolean value. The null data model can evaluate the instruction In(...)
, so this might result in an actual value, rather than an error.
[override virtual]
QString QScxmlNullDataModel::evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok)
Reimplemented from QScxmlDataModel::evaluateToString().
Evaluates the executable content pointed to by id and records in ok whether there was an error. Returns the result of the evaluation as a string. The null data model can evaluate the <log>
element, so this might result in an actual value, rather than an error
[override virtual]
QVariant QScxmlNullDataModel::evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok)
Reimplemented from QScxmlDataModel::evaluateToVariant().
Evaluates the executable content pointed to by id and records in ok whether there was an error. As this is the null data model, any evaluation will in fact result in an error, with ok set to false
. Returns an empty QVariant.
[override virtual]
void QScxmlNullDataModel::evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok)
Reimplemented from QScxmlDataModel::evaluateToVoid().
Evaluates the executable content pointed to by id and records in ok whether there was an error. As this is the null data model, any evaluation will in fact result in an error, with ok set to false
.
[override virtual]
bool QScxmlNullDataModel::hasScxmlProperty(const QString &name) const
Reimplemented from QScxmlDataModel::hasScxmlProperty().
Returns false
, because the null data model does not support properties.
[override virtual]
QVariant QScxmlNullDataModel::scxmlProperty(const QString &name) const
Reimplemented from QScxmlDataModel::scxmlProperty().
Returns an invalid variant, because the null data model does not support properties.
See also setScxmlProperty().
[override virtual]
void QScxmlNullDataModel::setScxmlEvent(const QScxmlEvent &event)
Reimplemented from QScxmlDataModel::setScxmlEvent().
Does not actually set the event, because the null data model does not handle events.
[override virtual]
bool QScxmlNullDataModel::setScxmlProperty(const QString &name, const QVariant &value, const QString &context)
Reimplemented from QScxmlDataModel::setScxmlProperty().
Returns false
, because the null data model does not support properties.
See also scxmlProperty().
[override virtual]
bool QScxmlNullDataModel::setup(const QVariantMap &initialDataValues)
Reimplemented from QScxmlDataModel::setup().
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.12/qscxmlnulldatamodel.html