内容表

上一话题

QScxmlCppDataModel

下一话题

QScxmlDynamicScxmlServiceFactory

QScxmlDataModel

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

Inheritance diagram of PySide2.QtScxml.QScxmlDataModel

继承者: QScxmlCppDataModel , QScxmlEcmaScriptDataModel , QScxmlNullDataModel

New in version 5.12.

概要

函数

虚函数

信号

详细描述

SCXML data models are described in SCXML Specification - 5 Data Model and Data Manipulation . For more information about supported data models, see SCXML 合规 .

One data model can only belong to one state machine.

class QScxmlDataModel ( [ parent=None ] )
param parent

QObject

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

PySide2.QtScxml.QScxmlDataModel. evaluateAssignment ( id , ok )
参数
  • 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 )
参数

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 )
参数
  • 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 )
参数

id int

返回类型

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 )
参数

id int

返回类型

unicode

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 )
参数

id int

返回类型

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 )
参数
  • 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 )
参数

name – unicode

返回类型

bool

返回 true if a property with the given name exists, false 否则。

PySide2.QtScxml.QScxmlDataModel. scxmlProperty ( name )
参数

name – unicode

返回类型

object

Returns the value of the property name .

PySide2.QtScxml.QScxmlDataModel. setScxmlEvent ( event )
参数

event QScxmlEvent

设置 event to use in the subsequent executable content execution.

PySide2.QtScxml.QScxmlDataModel. setScxmlProperty ( name , value , context )
参数
  • name – unicode

  • value – object

  • context – unicode

返回类型

bool

Sets a the value value for the property name .

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

返回 true if successful or false if an error occurred.

另请参阅

scxmlProperty()

PySide2.QtScxml.QScxmlDataModel. setStateMachine ( stateMachine )
参数

stateMachine QScxmlStateMachine

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.

另请参阅

stateMachine()

PySide2.QtScxml.QScxmlDataModel. setup ( initialDataValues )
参数

initialDataValues

返回类型

bool

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

返回 false if parse errors occur or if any of the initialization steps fail. Returns true 否则。

PySide2.QtScxml.QScxmlDataModel. stateMachine ( )
返回类型

QScxmlStateMachine

Returns the state machine associated with the data model.

另请参阅

setStateMachine()

PySide2.QtScxml.QScxmlDataModel. stateMachineChanged ( stateMachine )
参数

stateMachine QScxmlStateMachine