QScxmlEvent露

The QScxmlEvent class is an event for a Qt SCXML state machine. More鈥�

Inheritance diagram of PySide2.QtScxml.QScxmlEvent

Synopsis露

Functions露

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 .

class PySide2.QtScxml.QScxmlEvent露

PySide2.QtScxml.QScxmlEvent(other)

param other:

PySide2.QtScxml.QScxmlEvent

Creates a new external SCXML event.

Constructs a copy of other .

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

PySide2.QtScxml.QScxmlEvent.clear()露

Clears the contents of the event.

PySide2.QtScxml.QScxmlEvent.data()露
Return type:

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.

PySide2.QtScxml.QScxmlEvent.delay()露
Return type:

int

This property holds The delay in milliseconds after which the event is to be delivered after processing the <send> element..

PySide2.QtScxml.QScxmlEvent.errorMessage()露
Return type:

str

This property holds An error message for an error event, or an empty QString ..

PySide2.QtScxml.QScxmlEvent.eventType()露
Return type:

EventType

This property holds the type of the event..

PySide2.QtScxml.QScxmlEvent.invokeId()露
Return type:

str

This property holds the ID of the invoked state machine if the event is generated by one..

PySide2.QtScxml.QScxmlEvent.isErrorEvent()露
Return type:

bool

This property holds Whether the event represents an error..

PySide2.QtScxml.QScxmlEvent.name()露
Return type:

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.

PySide2.QtScxml.QScxmlEvent.origin()露
Return type:

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.

PySide2.QtScxml.QScxmlEvent.originType()露
Return type:

str

This property holds the origin type of an SCXML event..

The origin type is equivalent to the type attribute of the <send> element.

PySide2.QtScxml.QScxmlEvent.scxmlType()露
Return type:

str

This property holds The event type..

PySide2.QtScxml.QScxmlEvent.sendId()露
Return type:

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.

PySide2.QtScxml.QScxmlEvent.setData(data)露
Parameters:

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.

PySide2.QtScxml.QScxmlEvent.setDelay(delayInMiliSecs)露
Parameters:

delayInMiliSecs 鈥� int

This property holds The delay in milliseconds after which the event is to be delivered after processing the <send> element..

PySide2.QtScxml.QScxmlEvent.setErrorMessage(message)露
Parameters:

message 鈥� str

This property holds An error message for an error event, or an empty QString ..

PySide2.QtScxml.QScxmlEvent.setEventType(type)露
Parameters:

type 鈥� EventType

This property holds the type of the event..

PySide2.QtScxml.QScxmlEvent.setInvokeId(invokeId)露
Parameters:

invokeId 鈥� str

This property holds the ID of the invoked state machine if the event is generated by one..

PySide2.QtScxml.QScxmlEvent.setName(name)露
Parameters:

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.

PySide2.QtScxml.QScxmlEvent.setOrigin(origin)露
Parameters:

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.

PySide2.QtScxml.QScxmlEvent.setOriginType(originType)露
Parameters:

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.

PySide2.QtScxml.QScxmlEvent.setSendId(sendId)露
Parameters:

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.