simQML.createEngine
Description
|
Create a QML engine. |
Lua synopsis |
string handle=simQML.createEngine()
|
Lua parameters |
- |
Lua return values |
handle (string): qml engine handle |
Python synopsis |
string handle=simQML.createEngine()
|
See also
|
|
simQML.destroyEngine
Description
|
Destroy the specified QML engine. |
Lua synopsis |
simQML.destroyEngine(string handle)
|
Lua parameters |
handle (string): qml engine handle |
Lua return values |
- |
Python synopsis |
simQML.destroyEngine(string handle)
|
See also
|
|
simQML.imageDataURL
Description
|
Encode image data according to "data" URL scheme (RFC 2397). |
Lua synopsis |
string dataURL=simQML.imageDataURL(string data, int width, int height, string format="BMP", int data_format=sim_qml_image_data_format_rgb888)
|
Lua parameters |
data (string): raw image data
width (int): image width
height (int): image height
format (string, default: "BMP"): encoding format (must be "PNG", "JPG" or "BMP")
|
Lua return values |
dataURL (string): data URL |
Python synopsis |
string dataURL=simQML.imageDataURL(string data, int width, int height, string format="BMP", int data_format=sim_qml_image_data_format_rgb888)
|
See also
|
|
simQML.load
Description
|
Load a QML file in the specified engine. |
Lua synopsis |
simQML.load(string engineHandle, string filename)
|
Lua parameters |
engineHandle (string): qml engine handle
filename (string): qml file path
|
Lua return values |
- |
Python synopsis |
simQML.load(string engineHandle, string filename)
|
See also
|
|
simQML.loadData
Description
|
Load a QML from a string in the specified engine. |
Lua synopsis |
simQML.loadData(string engineHandle, string data, string basepath="")
|
Lua parameters |
engineHandle (string): qml engine handle
data (string): qml data
basepath (string, default: ""): base path for imports
|
Lua return values |
- |
Python synopsis |
simQML.loadData(string engineHandle, string data, string basepath="")
|
See also
|
|
simQML.sendEvent
Description
|
send an event with an object payload which will be serialized using JSON |
Lua synopsis |
simQML.sendEvent(string engine, string name, table data)
|
Lua parameters |
engine (string): the handle of the QML engine
name (string): the name of the event
data (table): the object payload
|
Lua return values |
- |
Python synopsis |
simQML.sendEvent(string engine, string name, list data)
|
See also
|
|
simQML.sendEventRaw
Description
|
Send an event to QML. In order to receive events in QML, a CoppeliaSimBridge object must be created, and its onEventReceived(name, data) handler must be implemented.
Predefined events sent by the plugin: when the scene is switched, an event with name "onInstanceSwitch" and data consisting of a single boolean JSON-serialized value, which will be true when the QML component's scene becomes active, and false when it becomes inactive. |
Lua synopsis |
simQML.sendEventRaw(string engineHandle, string eventName, string eventData)
|
Lua parameters |
engineHandle (string): qml engine handle
eventName (string): event name
eventData (string): event data
|
Lua return values |
- |
Python synopsis |
simQML.sendEventRaw(string engineHandle, string eventName, string eventData)
|
See also
|
|
simQML.setEventHandler
Description
|
registers the event handler for the engine, which will deserialize JSON payloads |
Lua synopsis |
simQML.setEventHandler(string engine, string funcName)
|
Lua parameters |
engine (string): the handle of the QML engine
funcName (string): the name of the function, called with args (engineHandle,eventName,eventData)
|
Lua return values |
- |
Python synopsis |
simQML.setEventHandler(string engine, string funcName)
|
See also
|
|
simQML.setEventHandlerRaw
Description
|
Set the event handler to receive events from QML. In order to send events in QML, a CoppeliaSimBridge object must be created, and its sendEvent(name, data) method must be called.
For information about receiving events in QML, see simQML.sendEvent. |
Lua synopsis |
simQML.setEventHandlerRaw(string engineHandle, string functionName)
|
Lua parameters |
engineHandle (string): qml engine handle
functionName (string): function name to be called when event is received: see onEventReceived
|
Lua return values |
- |
Python synopsis |
simQML.setEventHandlerRaw(string engineHandle, string functionName)
|
See also
|
|
|
Script functions
Script functions are used to call some lua code from the plugin side (tipically used for event handlers).
onEventReceivedRaw
Description
|
Callback for events sent from QML. The event handler must be registered with simQML.setEventHandlerRaw. |
Lua synopsis |
simQML.onEventReceivedRaw(string engineHandle, string eventName, string eventData)
|
Lua parameters |
engineHandle (string): qml engine handle
eventName (string): event name
eventData (string): event data
|
Lua return values |
- |
Python synopsis |
simQML.onEventReceivedRaw(string engineHandle, string eventName, string eventData)
|
See also
|
|
|