- class QScxmlEvent¶
The
QScxmlEvent
class is an event for a Qt SCXML state machine. More…Synopsis¶
Properties¶
dataᅟ
- The data included by the senderdelayᅟ
- In milliseconds after which the event is to be delivered after processing the <send> elementerrorEventᅟ
- Whether the event represents an errorerrorMessageᅟ
- An error message for an error event, or an empty QStringeventTypeᅟ
- The type of the eventinvokeIdᅟ
- The ID of the invoked state machine if the event is generated by onenameᅟ
- The name of the eventoriginᅟ
- The URI that points to the origin of an SCXML eventoriginTypeᅟ
- The origin type of an SCXML eventscxmlTypeᅟ
- Event typesendIdᅟ
- The ID of the event
Methods¶
def
__init__()
def
clear()
def
data()
def
delay()
def
errorMessage()
def
eventType()
def
invokeId()
def
isErrorEvent()
def
name()
def
origin()
def
originType()
def
scxmlType()
def
sendId()
def
setData()
def
setDelay()
def
setEventType()
def
setInvokeId()
def
setName()
def
setOrigin()
def
setOriginType()
def
setSendId()
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 events drive transitions. Most events are generated by using the
<raise>
and<send>
elements in the application. The state machine automatically generates some mandatory events, such as errors.For more information, see SCXML Specification - 5.10.1 The Internal Structure of Events . For more information about how the Qt SCXML API differs from the specification, see SCXML Compliance .
See also
- class EventType¶
This enum type specifies the type of an SCXML event:
Constant
Description
QScxmlEvent.PlatformEvent
An event generated internally by the state machine. For example, errors.
QScxmlEvent.InternalEvent
An event generated by a
<raise>
element.QScxmlEvent.ExternalEvent
An event generated by a
<send>
element.
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property dataᅟ: object¶
This property holds the data included by the sender..
When
<param>
elements are used in the<send>
element, the data will contain a QVariantMap where the key is the name attribute, and the value is taken from the expr attribute or the location attribute.When a
<content>
element is used, the data will contain a single item with either the value of the expr attribute of the<content>
element or the child data of the<content>
element.- property delayᅟ: int¶
This property holds The delay in milliseconds after which the event is to be delivered after processing the
<send>
element..- Access functions:
- property errorEventᅟ: bool¶
This property holds Whether the event represents an error..
- Access functions:
- property errorMessageᅟ: str¶
This property holds An error message for an error event, or an empty QString..
- Access functions:
- property eventTypeᅟ: QScxmlEvent.EventType¶
This property holds the type of the event..
- Access functions:
- property invokeIdᅟ: str¶
This property holds the ID of the invoked state machine if the event is generated by one..
- Access functions:
- property nameᅟ: str¶
This property holds the name of the event..
If the event is generated inside the SCXML document, this property holds the value of the event attribute specified inside the
<raise>
or<send>
element.If the event is created in the C++ code and submitted to the
QScxmlStateMachine
, the value of this property is matched against the value of the event attribute specified inside the<transition>
element in the SCXML document.- property originᅟ: str¶
This property holds the URI that points to the origin of an SCXML event..
The origin is equivalent to the target attribute of the
<send>
element.- Access functions:
- property originTypeᅟ: str¶
This property holds the origin type of an SCXML event..
The origin type is equivalent to the type attribute of the
<send>
element.- Access functions:
- property scxmlTypeᅟ: str¶
This property holds The event type..
- Access functions:
- property sendIdᅟ: str¶
This property holds the ID of the event..
The ID is used by the
<cancel>
element to identify the event to be canceled.Note
The state machine generates a unique ID if the id attribute is not specified in the
<send>
element. The generated ID can be accessed through this property.- Access functions:
- __init__()¶
Creates a new external SCXML event.
- __init__(other)
- Parameters:
other –
QScxmlEvent
Constructs a copy of
other
.- clear()¶
Clears the contents of the event.
- data()¶
- Return type:
object
Returns the data included by the sender.
See also
Getter of property
dataᅟ
.- delay()¶
- Return type:
int
Returns the delay in milliseconds after which this event is to be delivered after processing the
<send>
element.See also
Getter of property
delayᅟ
.- errorMessage()¶
- Return type:
str
If this is an error event, returns the error message. Otherwise, returns an empty QString.
See also
Getter of property
errorMessageᅟ
.Returns the type of this event.
See also
Getter of property
eventTypeᅟ
.- invokeId()¶
- Return type:
str
If this event is generated by an invoked state machine, returns the ID of the
<invoke>
element. Otherwise, returns an empty value.See also
Getter of property
invokeIdᅟ
.- isErrorEvent()¶
- Return type:
bool
Returns
true
when this is an error event,false
otherwise.Getter of property
errorEventᅟ
.- name()¶
- Return type:
str
Returns the name of the event.
See also
Getter of property
nameᅟ
.- origin()¶
- Return type:
str
Returns a URI that points to the origin of an SCXML event.
See also
Getter of property
originᅟ
.- originType()¶
- Return type:
str
Returns the origin type of an SCXML event.
See also
Getter of property
originTypeᅟ
.- scxmlType()¶
- Return type:
str
Returns the event type.
Getter of property
scxmlTypeᅟ
.- sendId()¶
- Return type:
str
Returns the ID of the event.
See also
Getter of property
sendIdᅟ
.- setData(data)¶
- Parameters:
data – object
Sets the payload data to
data
.See also
Setter of property
dataᅟ
.- setDelay(delayInMiliSecs)¶
- Parameters:
delayInMiliSecs – int
Sets the delay in milliseconds as the value of
delayInMiliSecs
.See also
Setter of property
delayᅟ
.- setErrorMessage(message)¶
- Parameters:
message – str
If this is an error event, the
message
is set as the error message.See also
Setter of property
errorMessageᅟ
.Sets the event type to
type
.Setter of property
eventTypeᅟ
.- setInvokeId(invokeId)¶
- Parameters:
invokeId – str
Sets the ID of an invoked state machine to
invokeid
.See also
Setter of property
invokeIdᅟ
.- setName(name)¶
- Parameters:
name – str
Sets the name of the event to
name
.See also
Setter of property
nameᅟ
.- setOrigin(origin)¶
- Parameters:
origin – str
Sets the origin of an SCXML event to
origin
.See also
Setter of property
originᅟ
.- setOriginType(originType)¶
- Parameters:
originType – str
Sets the origin type of an SCXML event to
origintype
.See also
Setter of property
originTypeᅟ
.- setSendId(sendId)¶
- Parameters:
sendId – str
Sets the ID
sendid
for this event.See also
Setter of property
sendIdᅟ
.