QScxmlDataModelclass is the data model base class for a Qt SCXML state machine. 更多 …
继承者: QScxmlCppDataModel , QScxmlEcmaScriptDataModel , QScxmlNullDataModel
New in version 5.12.
def
setStateMachine
(stateMachine)
def
stateMachine
()
def
evaluateAssignment
(id, ok)
def
evaluateForeach
(id, ok, body)
def
evaluateInitialization
(id, ok)
def
evaluateToBool
(id)
def
evaluateToString
(id)
def
evaluateToVariant
(id)
def
evaluateToVoid
(id, ok)
def
hasScxmlProperty
(name)
def
scxmlProperty
(name)
def
setScxmlEvent
(event)
def
setScxmlProperty
(name, value, context)
def
setup
(initialDataValues)
def
stateMachineChanged
(stateMachine)
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.
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
)
¶
id
–
int
ok
–
bool
body
–
ForeachLoopBody
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.
另请参阅
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.
另请参阅
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
(
)
¶
Returns the state machine associated with the data model.
另请参阅
PySide2.QtScxml.QScxmlDataModel.
stateMachineChanged
(
stateMachine
)
¶
stateMachine
–
QScxmlStateMachine