IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QScxmlNullDataModel Class

The QScxmlNullDataModel class is the null data model for a Qt SCXML stateMachine.

This class was introduced in Qt 5.7.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QScxmlNullDataModel Class

  • Header: QScxmlNullDataModel

  • Since: Qt 5.7

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Scxml)

    target_link_libraries(mytarget PRIVATE Qt6::Scxml)

  • qmake: QT += scxml

  • Inherits: QScxmlDataModel

Detailed Description

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

Member Function Documentation

 

[explicit] 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)

Reimplements: QScxmlDataModel::evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok).

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)

Reimplements: QScxmlDataModel::evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, QScxmlDataModel::ForeachLoopBody *body).

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)

Reimplements: QScxmlDataModel::evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok).

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)

Reimplements: QScxmlDataModel::evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok).

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)

Reimplements: QScxmlDataModel::evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok).

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)

Reimplements: QScxmlDataModel::evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok).

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)

Reimplements: QScxmlDataModel::evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok).

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

Reimplements: QScxmlDataModel::hasScxmlProperty(const QString &name) const.

Returns false, because the null data model does not support properties.

[override virtual] QVariant QScxmlNullDataModel::scxmlProperty(const QString &name) const

Reimplements: QScxmlDataModel::scxmlProperty(const QString &name) const.

Returns an invalid variant, because the null data model does not support properties.

See Also

See also setScxmlProperty()

[override virtual] void QScxmlNullDataModel::setScxmlEvent(const QScxmlEvent &event)

Reimplements: QScxmlDataModel::setScxmlEvent(const QScxmlEvent &event).

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)

Reimplements: QScxmlDataModel::setScxmlProperty(const QString &name, const QVariant &value, const QString &context).

Returns false, because the null data model does not support properties.

See Also

See also scxmlProperty()

[override virtual] bool QScxmlNullDataModel::setup(const QVariantMap &initialDataValues)

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+