QScxmlNullDataModel Class

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

頭: #include <QScxmlNullDataModel>
qmake: QT += scxml
Since: Qt 5.7
繼承: QScxmlDataModel

公共函數

QScxmlNullDataModel (QObject * parent = nullptr)
~QScxmlNullDataModel ()

重實現公共函數

virtual void evaluateAssignment (QScxmlExecutableContent::EvaluatorId id , bool * ok )
virtual void evaluateForeach (QScxmlExecutableContent::EvaluatorId id , bool * ok , ForeachLoopBody * body )
virtual void evaluateInitialization (QScxmlExecutableContent::EvaluatorId id , bool * ok )
virtual bool evaluateToBool (QScxmlExecutableContent::EvaluatorId id , bool * ok )
virtual QString evaluateToString (QScxmlExecutableContent::EvaluatorId id , bool * ok )
virtual QVariant evaluateToVariant (QScxmlExecutableContent::EvaluatorId id , bool * ok )
virtual void evaluateToVoid (QScxmlExecutableContent::EvaluatorId id , bool * ok )
virtual bool hasScxmlProperty (const QString & name ) const
virtual QVariant scxmlProperty (const QString & name ) const
virtual void setScxmlEvent (const QScxmlEvent & event )
virtual bool setScxmlProperty (const QString & name , const QVariant & value , const QString & context )
virtual bool setup (const QVariantMap & initialDataValues )

額外繼承成員

詳細描述

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" datamodel 屬性在 <scxml> element means that there is no underlying data model, but some executable content, like In(...) or <log> can still be used.

另請參閱 QScxmlStateMachine and QScxmlDataModel .

成員函數文檔編製

QScxmlNullDataModel:: QScxmlNullDataModel ( QObject * parent = nullptr)

Creates a new Qt SCXML null data model, with the parent object parent .

QScxmlNullDataModel:: ~QScxmlNullDataModel ()

Destroys the data model.

[虛擬] void QScxmlNullDataModel:: evaluateAssignment ( QScxmlExecutableContent::EvaluatorId id , bool * ok )

重實現自 QScxmlDataModel::evaluateAssignment ().

Throws an error and sets ok to false , because the null data model cannot evaluate assignments.

[虛擬] void QScxmlNullDataModel:: evaluateForeach ( QScxmlExecutableContent::EvaluatorId id , bool * ok , ForeachLoopBody * body )

重實現自 QScxmlDataModel::evaluateForeach ().

Throws an error and sets ok to false , because the null data model cannot evaluate <foreach> blocks.

[虛擬] void QScxmlNullDataModel:: evaluateInitialization ( QScxmlExecutableContent::EvaluatorId id , bool * ok )

重實現自 QScxmlDataModel::evaluateInitialization ().

Throws an error and sets ok to false , because the null data model cannot initialize data.

[虛擬] bool QScxmlNullDataModel:: evaluateToBool ( QScxmlExecutableContent::EvaluatorId id , bool * ok )

重實現自 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.

[虛擬] QString QScxmlNullDataModel:: evaluateToString ( QScxmlExecutableContent::EvaluatorId id , bool * ok )

重實現自 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

[虛擬] QVariant QScxmlNullDataModel:: evaluateToVariant ( QScxmlExecutableContent::EvaluatorId id , bool * ok )

重實現自 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 設為 false . Returns an empty QVariant .

[虛擬] void QScxmlNullDataModel:: evaluateToVoid ( QScxmlExecutableContent::EvaluatorId id , bool * ok )

重實現自 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 設為 false .

[虛擬] bool QScxmlNullDataModel:: hasScxmlProperty (const QString & name ) const

重實現自 QScxmlDataModel::hasScxmlProperty ().

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

[虛擬] QVariant QScxmlNullDataModel:: scxmlProperty (const QString & name ) const

重實現自 QScxmlDataModel::scxmlProperty ().

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

另請參閱 setScxmlProperty ().

[虛擬] void QScxmlNullDataModel:: setScxmlEvent (const QScxmlEvent & event )

重實現自 QScxmlDataModel::setScxmlEvent ().

Does not actually set the event , because the null data model does not handle events.

[虛擬] bool QScxmlNullDataModel:: setScxmlProperty (const QString & name , const QVariant & value , const QString & context )

重實現自 QScxmlDataModel::setScxmlProperty ().

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

另請參閱 scxmlProperty ().

[虛擬] bool QScxmlNullDataModel:: setup (const QVariantMap & initialDataValues )

重實現自 QScxmlDataModel::setup ().