- class QScxmlDataModel¶
The
QScxmlDataModel
class is the data model base class for a Qt SCXML state machine. More…Inherited by:
QScxmlNullDataModel
,QScxmlCppDataModel
Synopsis¶
Properties¶
stateMachineᅟ
- State machine this data model belongs to
Methods¶
def
__init__()
def
stateMachine()
Virtual methods¶
def
evaluateToBool()
def
evaluateToVoid()
def
scxmlProperty()
def
setScxmlEvent()
def
setup()
Signals¶
Static functions¶
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
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.
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property stateMachineᅟ: 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 thestateMachine
.- Access functions:
Creates a new data model, with the parent object
parent
.- static createScxmlDataModel(pluginKey)¶
- Parameters:
pluginKey – str
- Return type:
Creates a data model from a plugin specified by a
pluginKey
.- abstract evaluateAssignment(id, ok)¶
- Parameters:
id – int
ok – bool
Evaluates the assignment pointed to by
id
and setsok
tofalse
if there was an error or totrue
if there was not.- abstract evaluateForeach(id, ok, body)¶
- Parameters:
id – int
ok – bool
body –
ForeachLoopBody
Evaluates the foreach loop pointed to by
id
and setsok
tofalse
if there was an error or totrue
if there was not. Thebody
is executed on each iteration.- abstract evaluateInitialization(id, ok)¶
- Parameters:
id – int
ok – bool
Evaluates the initialization pointed to by
id
and setsok
tofalse
if there was an error or totrue
if there was not.- abstract evaluateToBool(id)¶
- Parameters:
id – int
- Return type:
bool
Evaluates the executable content pointed to by
id
and setsok
tofalse
if there was an error or totrue
if there was not. Returns the result of the evaluation as a boolean value.- abstract evaluateToString(id)¶
- Parameters:
id – int
- Return type:
str
Evaluates the executable content pointed to by
id
and setsok
tofalse
if there was an error or totrue
if there was not. Returns the result of the evaluation as a QString.- abstract evaluateToVariant(id)¶
- Parameters:
id – int
- Return type:
object
Evaluates the executable content pointed to by
id
and setsok
tofalse
if there was an error or totrue
if there was not. Returns the result of the evaluation as a QVariant.- abstract evaluateToVoid(id, ok)¶
- Parameters:
id – int
ok – bool
Evaluates the executable content pointed to by
id
and setsok
tofalse
if there was an error or totrue
if there was not. The execution is expected to return no result.- abstract hasScxmlProperty(name)¶
- Parameters:
name – str
- Return type:
bool
Returns
true
if a property with the givenname
exists,false
otherwise.- abstract scxmlProperty(name)¶
- Parameters:
name – str
- Return type:
object
Returns the value of the property
name
.See also
- abstract setScxmlEvent(event)¶
- Parameters:
event –
QScxmlEvent
Sets the
event
to use in the subsequent executable content execution.- abstract setScxmlProperty(name, value, context)¶
- Parameters:
name – str
value – object
context – str
- Return type:
bool
Sets a the value
value
for the propertyname
.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 orfalse
if an error occurred.See also
- setStateMachine(stateMachine)¶
- Parameters:
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.See also
Setter of property
stateMachineᅟ
.- abstract setup(initialDataValues)¶
- Parameters:
initialDataValues – Dictionary with keys of type .QString and values of type QVariant.
- 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. Returnstrue
otherwise.- stateMachine()¶
- Return type:
Returns the state machine associated with the data model.
See also
Getter of property
stateMachineᅟ
.- stateMachineChanged(stateMachine)¶
- Parameters:
stateMachine –
QScxmlStateMachine
Notification signal of property
stateMachineᅟ
.