QScxmlDataModel

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

Inheritance diagram of PySide2.QtScxml.QScxmlDataModel

Inherited by: QScxmlCppDataModel, QScxmlEcmaScriptDataModel, QScxmlNullDataModel

New in version 5.12.

Synopsis

Functions

Virtual functions

Signals

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.

class PySide2.QtScxml.QScxmlDataModel([parent=None])
param parent:

PySide2.QtCore.QObject

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

PySide2.QtScxml.QScxmlDataModel.evaluateAssignment(id, ok)
Parameters:
  • id – int

  • ok – bool

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

PySide2.QtScxml.QScxmlDataModel.evaluateForeach(id, ok, body)
Parameters:

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.

PySide2.QtScxml.QScxmlDataModel.evaluateInitialization(id, ok)
Parameters:
  • id – int

  • ok – bool

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

PySide2.QtScxml.QScxmlDataModel.evaluateToBool(id)
Parameters:

id – int

Return type:

bool

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.

PySide2.QtScxml.QScxmlDataModel.evaluateToString(id)
Parameters:

id – int

Return type:

str

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 .

PySide2.QtScxml.QScxmlDataModel.evaluateToVariant(id)
Parameters:

id – int

Return type:

object

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 .

PySide2.QtScxml.QScxmlDataModel.evaluateToVoid(id, ok)
Parameters:
  • id – int

  • ok – bool

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.

PySide2.QtScxml.QScxmlDataModel.hasScxmlProperty(name)
Parameters:

name – str

Return type:

bool

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

PySide2.QtScxml.QScxmlDataModel.scxmlProperty(name)
Parameters:

name – str

Return type:

object

Returns the value of the property name .

PySide2.QtScxml.QScxmlDataModel.setScxmlEvent(event)
Parameters:

eventPySide2.QtScxml.QScxmlEvent

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

PySide2.QtScxml.QScxmlDataModel.setScxmlProperty(name, value, context)
Parameters:
  • name – str

  • value – object

  • context – str

Return type:

bool

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

scxmlProperty()

PySide2.QtScxml.QScxmlDataModel.setStateMachine(stateMachine)
Parameters:

stateMachinePySide2.QtScxml.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 .

PySide2.QtScxml.QScxmlDataModel.setup(initialDataValues)
Parameters:

initialDataValues

Return type:

bool

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.

PySide2.QtScxml.QScxmlDataModel.stateMachine()
Return type:

PySide2.QtScxml.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 .

PySide2.QtScxml.QScxmlDataModel.stateMachineChanged(stateMachine)
Parameters:

stateMachinePySide2.QtScxml.QScxmlStateMachine