Element QML Type

Control type for elements in a Qt 3D Studio presentation. More...

Import Statement: import QtStudio3D.OpenGL 2.6
Instantiates: Q3DSElement



Detailed Description

This class is provided for backwards compatibility. We recommend using DataInput and DataOutput APIs for contractual and clean API between the design and the code.

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.

Note: The functionality of Element is equivalent to Presentation::setAttribute() and Presentation::fireEvent().

See also DataInput, DataOutput, Studio3D, SceneElement, Presentation, DataInput, and DataOutput.

Property Documentation

elementPath : string

Holds the element path of the presentation element.

An element path refers to an object in the scene by name, 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 Scene.Layer2.Camera).

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 SomeMaterial.diffusemap.

To access an object in a sub-presentation, prepend the name of the sub-presentation followed by a colon, for example, SubPresentationOne:Scene.Layer.Camera.

Method Documentation

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.

void setAttribute(string attributeName, variant value)

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.