C

Presentation QML Type

Control type for Qt 3D Studio presentations. More...

Import Statement: import QtStudio3D 1.0

Properties

Signals

Methods

Detailed Description

This type provides properties and methods for controlling a presentation.

All methods provided by this type are queued and handled asynchronously before the next frame is displayed.

See also Studio3D.

Property Documentation

source : url

Holds the presentation source (*.uia or *.uip) file location. May be either a file URL or a qrc URL.


subPresentationSettings : SubPresentationSettings

Holds the settings for the subpresentations in the Qt 3D Studio presentation.

This property is read-only.


Signal Documentation

slideEntered(string elementPath, int index, string name)

This signal is emitted when a slide is entered in the presentation. The elementPath specifies the time context (a Scene or a Component element) owning the entered slide. The index and name contain the index and the name of the entered slide.


slideExited(string elementPath, int index, string name)

This signal is emitted when a slide is exited in the presentation. The elementPath specifies the time context (a Scene or a Component element) owning the exited slide. The index and name contain the index and the name of the exited slide.


sourceChanged(url source)

This signal is emitted when the source property has changed. The new value is provided in the source parameter.

The corresponding handler is onSourceChanged.


Method Documentation

void fireEvent(string elementPath, string eventName)

Dispatches an event with eventName on a specific element found in elementPath. Appropriate Appropriate actions created in Qt 3D Studio or callbacks registered using the registerForEvent() method in attached scripts will be executed in response to the event.

You can target the command to a specific sub-presentation by adding "SubPresentationId:" in front of the element path, for example "SubPresentationOne:Scene.Mesh".


void goToSlide(string elementPath, bool next, bool wrap)

Requests a time context (a Scene or a Component element) to change to the next or the previous slide, depending on the value of next. If the context is already at the last or first slide, wrap defines if change occurs to the opposite end.

If elementPath points to a time context, that element is controlled. For all other element types the time context owning that element is controlled instead. You can target the command to a specific sub-presentation by adding "SubPresentationId:" in front of the element path, for example "SubPresentationOne:Scene".


void goToSlide(string elementPath, int index)

Requests a time context (a Scene or a Component element) to change to a specific slide by index index. If the context is already on that slide playback will start over.

If elementPath points to a time context, that element is controlled. For all other element types the time context owning that element is controlled instead. You can target the command to a specific sub-presentation by adding "SubPresentationId:" in front of the element path, for example "SubPresentationOne:Scene".


void goToSlide(string elementPath, string name)

Requests a time context (a Scene or a Component element) to change to a specific slide by name. If the context is already on that slide playback will start over.

If elementPath points to a time context, that element is controlled. For all other element types the time context owning that element is controlled instead. You can target the command to a specific sub-presentation by adding "SubPresentationId:" in front of the element path, for example "SubPresentationOne:Scene".


void goToTime(string elementPath, real time)

Sets a time context (a Scene or a Component element) to a specific playback time in seconds.

If elementPath points to a time context, that element is controlled. For all other element types the time context owning that element is controlled instead. You can target the command to a specific sub-presentation by adding "SubPresentationId:" in front of the element path, for example "SubPresentationOne:Scene".

The behavior when specifying a time before 0 or after the end time for the current slide depends on the play mode of the slide:

  • Stop at End - values outside the valid time range instead clamp to the boundaries. For example, going to time -5 is the same as going to time 0.
  • Looping - values outside the valid time range mod into the valid range. For example, going to time -4 on a 10 second slide is the same as going to time 6.
  • Ping Pong - values outside the valid time range ‘bounce’ off the ends. For example, going to time -4 is the same as going to time 4 (assuming the time context is at least 4 seconds long), while going to time 12 on a 10 second slide is the same as going to time 8.
  • Ping - values less than 0 are treated as time 0, while values greater than the endtime bounce off the end (eventually hitting 0.)

void setAttribute(string elementPath, string attributeName, variant value)

Sets the value of an attribute on an element found at elementPath. The attributeName is the scripting name of the attribute.

You can target the command to a specific sub-presentation by adding "SubPresentationId:" in front of the element path, for example "SubPresentationOne:Scene.Mesh.Material".

The attribute must be preserved for scripting to be set by this function, or else it will fail. An attribute is preserved if it is either animated, or an attribute on a master element that is unlinked and changed per-slide.


void setDataInputValue(string name, variant value)

Sets the value of a data input element name in the presentation.

This QML method was introduced in QtStudio3D 1.1.


void setGlobalAnimationTime(int64 milliseconds)

Sets the global animation time to milliseconds. Setting the global animation time to a non-zero value will disable the automatic animation timer. Setting the value to zero resumes automatic animation timer.


void setPresentationActive(string id, bool active)

Stops or starts updates to a sub-presentation based on the active flag. The presentation is referenced to by the id, which is the name of the presentation without the .uip.

Making a presentation inactive prevents any elements, behaviors, and animations within it from updating. It also prevents any events within that presentation from being processed. It does not, however, prevent the presentation from rendering. An inactive presentation will continue to render using its last-updated information.

Explicitly inactivating presentations can provide a significant performance increase, depending on the number and size of the presentations that are inactive. Inactive presentations are not ‘paused’. When the presentation is re-activated, animations will resume at the time they should be had they been running, not where they were when the presentation was made inactive.


Available under certain Qt licenses.
Find out more.