Element QML Type
Control type for elements in a Qt 3D Studio presentation. More...
- elementPath : string
- void fireEvent(string eventName)
- variant getAttribute(string attributeName)
- void setAttribute(string attributeName, variant value)
This type is a convenience for controlling the properties of a scene object (such as, model, material, camera, layer) in a Qt 3D Studio presentation.
elementPath : string
Holds the element path of the presentation element.
An element path refers to an object in the scene either by name or id. The latter is rarely used in application code since the unique IDs are not exposed in the Qt 3D Studio application. To refer to an object by id, prepend
# to the name. Applications will typically refer to objects by name.
Names are not necessarily unique, however. To access an object with a non-unique name, the path can be specified, for example,
Scene.Layer.Camera. Here the right camera object gets chosen even if the scene contains other layers with the default camera names (for instance
If the object is renamed to a unique name in the Qt 3D Studio application's Timeline view, the path can be omitted. For example, if the camera in question was renamed to
MyCamera, applications can then simply pass
MyCamera as the element path.
To reference an object stored in a property of another object, the dot syntax can be used. The most typical example of this is changing the source of a texture map by changing the
sourcepath property on the object selected by
To access an object in a sub-presentation, prepend the name of the sub-presentation followed by a colon, for example,
void fireEvent(string eventName)
Dispatches an event with eventName on the scene object specified by elementPath.
Appropriate actions created in Qt 3D Studio or callbacks registered using the registerForEvent() method in attached
behavior scripts will be executed in response to the event.
Returns the current value of an attribute (property) of the scene object specified by this Element instance. The attributeName is the scripting name of the attribute.
Sets the value of an attribute (property) of the scene object specified by this Element instance. The attributeName is the scripting name of the attribute.
Available under certain Qt licenses.
Find out more.