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

QScxmlDataModel Class

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

This class was introduced in Qt 5.7.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QScxmlDataModel Class

  • Header: QScxmlDataModel

  • Since: Qt 5.7

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Scxml)

    target_link_libraries(mytarget PRIVATE Qt6::Scxml)

  • qmake: QT += scxml

  • Inherits: QObject

  • Inherited By: QScxmlCppDataModel and QScxmlNullDataModel

Detailed Description

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

Property Documentation

 

[bindable] stateMachine : QScxmlStateMachine*

This property supports QProperty bindings.

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.

Member Function Documentation

 

[explicit] QScxmlDataModel::QScxmlDataModel(QObject *parent = nullptr)

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

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

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

[static] QScxmlDataModel *QScxmlDataModel::createScxmlDataModel(const QString &pluginKey)

Creates a data model from a plugin specified by a pluginKey.

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

Evaluates the assignment pointed to by id and sets ok to false if there was an error or to true if there was not.

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

Evaluates the foreach loop pointed to by id and sets ok to false if there was an error or to true if there was not. The body is executed on each iteration.

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

Evaluates the initialization pointed to by id and sets ok to false if there was an error or to true if there was not.

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

Evaluates the executable content pointed to by id and sets ok to false if there was an error or to true if there was not. Returns the result of the evaluation as a boolean value.

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

Evaluates the executable content pointed to by id and sets ok to false if there was an error or to true if there was not. Returns the result of the evaluation as a QString.

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

Evaluates the executable content pointed to by id and sets ok to false if there was an error or to true if there was not. Returns the result of the evaluation as a QVariant.

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

Evaluates the executable content pointed to by id and sets ok to false if there was an error or to true if there was not. The execution is expected to return no result.

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

Returns true if a property with the given name exists, false otherwise.

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

Returns the value of the property name.

See Also

See also setScxmlProperty()

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

Sets the event to use in the subsequent executable content execution.

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

Sets a the value value for the property name.

The context is a string that is used in error messages to indicate the location in the SCXML file where the error occurred.

Returns true if successful or false if an error occurred.

See Also

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.

Setter function for property stateMachine.

See Also

See also stateMachine()

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

Initializes the data model with the initial values specified by initialDataValues.

Returns false if parse errors occur or if any of the initialization steps fail. Returns true otherwise.

QScxmlStateMachine *QScxmlDataModel::stateMachine() const

Returns the state machine associated with the data model.

Getter function for property stateMachine.

See Also

See also setStateMachine()

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