C

Q3DSPresentation Class

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

Header: #include <q3dspresentation.h>
Inherits: QObject

Properties

  • 1 property inherited from QObject

Public Functions

void keyPressEvent(QKeyEvent *e)
void keyReleaseEvent(QKeyEvent *e)
void mouseMoveEvent(QMouseEvent *e)
void mousePressEvent(QMouseEvent *e)
void mouseReleaseEvent(QMouseEvent *e)
void registerDataInput(Q3DSDataInput *dataInput)
void registerElement(Q3DSElement *element)
Q3DSDataInput *registeredDataInput(const QString &name) const
Q3DSElement *registeredElement(const QString &elementPath) const
QUrl source() const
void unregisterDataInput(Q3DSDataInput *dataInput)
void unregisterElement(Q3DSElement *element)
void wheelEvent(QWheelEvent *e)
  • 32 public functions inherited from QObject

Public Slots

void fireEvent(const QString &elementPath, const QString &eventName)
void goToSlide(const QString &elementPath, unsigned int index)
void goToSlide(const QString &elementPath, const QString &name)
void goToSlide(const QString &elementPath, bool next, bool wrap)
void goToTime(const QString &elementPath, float time)
void setAttribute(const QString &elementPath, const QString &attributeName, const QVariant &value)
void setDataInputValue(const QString &name, const QVariant &value)
void setGlobalAnimationTime(qint64 milliseconds)
void setPresentationActive(const QString &id, bool active)
void setSource(const QUrl &source)
  • 1 public slot inherited from QObject

Signals

void slideEntered(const QString &elementPath, unsigned int index, const QString &name)
void slideExited(const QString &elementPath, unsigned int index, const QString &name)
void sourceChanged(const QUrl &source)

Additional Inherited Members

  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

Control class for Qt 3D Studio presentations.

This class provides properties and methods for controlling a presentation.

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

You should never construct this class yourself. You can ask for an instance from Q3DSSurfaceViewer or Q3DSWidget.

Property Documentation

source : QUrl

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

Access functions:

QUrl source() const
void setSource(const QUrl &source)

Notifier signal:

void sourceChanged(const QUrl &source)

Member Function Documentation

[slot] void Q3DSPresentation::fireEvent(const QString &elementPath, const QString &eventName)

Dispatches an event with eventName on a specific element found in elementPath. 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".

[slot] void Q3DSPresentation::goToSlide(const QString &elementPath, unsigned int index)

Requests a time context (a Scene or a Component element) to change to a specific slide by 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".

[slot] void Q3DSPresentation::goToSlide(const QString &elementPath, const QString &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".

[slot] void Q3DSPresentation::goToSlide(const QString &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".

[slot] void Q3DSPresentation::goToTime(const QString &elementPath, float 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 Q3DSPresentation::keyPressEvent(QKeyEvent *e)

Passes a key press event e to the presentation. An attached script can register callback for onKeyDown event to handle key presses.

void Q3DSPresentation::keyReleaseEvent(QKeyEvent *e)

Passes a key release event e to the presentation. An attached script can register callback for onKeyUp event to handle key releases.

void Q3DSPresentation::mouseMoveEvent(QMouseEvent *e)

Passes a mouse move event e to the presentation. Currently it is not possible to react to this event in the presentation.

void Q3DSPresentation::mousePressEvent(QMouseEvent *e)

Passes a mouse press event e to the presentation. This will send onPressureDown event to the element at the coordinates specified by the event.

void Q3DSPresentation::mouseReleaseEvent(QMouseEvent *e)

Passes a mouse release event e to the presentation. This will send onPressureUp and onTap events to the element at the coordinates specified by the event.

void Q3DSPresentation::registerDataInput(Q3DSDataInput *dataInput)

Registers a dataInput for the presentation. The registered dataInput can be used to manage the corresponding data input in the presentation.

This function was introduced in QtStudio3D 1.1.

void Q3DSPresentation::registerElement(Q3DSElement *element)

Registers an element for the presentation. The registered element can be used to manage the corresponding element in the presentation.

Q3DSDataInput *Q3DSPresentation::registeredDataInput(const QString &name) const

Returns a pointer to a registered data input with name. If no data input with given name is registered, a null pointer is returned.

This function was introduced in QtStudio3D 1.1.

Q3DSElement *Q3DSPresentation::registeredElement(const QString &elementPath) const

Returns a pointer to a registered element with elementPath. If no element with given path is registered, a null pointer is returned.

[slot] void Q3DSPresentation::setAttribute(const QString &elementPath, const QString &attributeName, const QVariant &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.

[slot] void Q3DSPresentation::setDataInputValue(const QString &name, const QVariant &value)

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

This function was introduced in QtStudio3D 1.1.

[slot] void Q3DSPresentation::setGlobalAnimationTime(qint64 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.

[slot] void Q3DSPresentation::setPresentationActive(const QString &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.

[signal] void Q3DSPresentation::slideEntered(const QString &elementPath, unsigned int index, const QString &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.

[signal] void Q3DSPresentation::slideExited(const QString &elementPath, unsigned int index, const QString &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.

void Q3DSPresentation::unregisterDataInput(Q3DSDataInput *dataInput)

Unregisters a dataInput from the presentation.

This function was introduced in QtStudio3D 1.1.

void Q3DSPresentation::unregisterElement(Q3DSElement *element)

Unregisters an element from the presentation.

void Q3DSPresentation::wheelEvent(QWheelEvent *e)

Passes a wheel event e to the presentation. An attached script can register callbacks for onHorizontalScrollWheel and onVerticalScrollWheel events to handle wheel events.

Available under certain Qt licenses.
Find out more.