diff options
Diffstat (limited to 'src/imports/studio3d')
-rw-r--r-- | src/imports/studio3d/q3dsstudio3ditem.cpp | 54 | ||||
-rw-r--r-- | src/imports/studio3d/q3dssubpresentationsettings.cpp | 50 |
2 files changed, 66 insertions, 38 deletions
diff --git a/src/imports/studio3d/q3dsstudio3ditem.cpp b/src/imports/studio3d/q3dsstudio3ditem.cpp index b585122..1c16b89 100644 --- a/src/imports/studio3d/q3dsstudio3ditem.cpp +++ b/src/imports/studio3d/q3dsstudio3ditem.cpp @@ -89,36 +89,42 @@ QT_BEGIN_NAMESPACE } } \endqml -*/ -/*! - \qmlsignal Studio3D::frameUpdate() + \section2 Controlling the presentation - This signal is emitted each time a frame has been updated regardless of - visibility. This allows a hidden Studio3D element to still process - information every frame, even though the renderer is not rendering. + Like the example above suggests, Studio3D and the other types under the + QtStudio3D import offer more than simply rendering the animated Qt 3D + Studio presentation. They also offer scene manipulation, including - The corresponding handler is \c onFrameUpdate. + \list - To prevent expensive handlers from being processed when hidden, add an - early return to the top like: + \li querying and changing scene object properties (for example, the + transform of a model, colors and other settings of a material, etc.) via + Presentation::getAttribute(), Presentation::setAttribute(), \l Element, and + \l DataInput, - \qml - onFrameUpdate: { - if (!visible) return; - ... - } - \endqml + \li changing slides (and thus starting the relevant animations and applying + the scene object property changes associated with the new slide) via + Presentation::goToSlide(), \l SceneElement, and \l DataInput, + + \li and controlling the timeline (the current playback position for the + key-frame based animations) both on the main scene and on individual + Component nodes via Presentation::goToTime(), \l SceneElement, and \l DataInput. + + \endlist +*/ + +/*! + \qmlsignal Studio3D::frameUpdate() + + This signal is emitted each time a frame has been rendered. */ /*! \qmlsignal Studio3D::presentationReady() This signal is emitted when the viewer has been initialized and the - presentation is ready to be shown. The difference to \c running property is - that the viewer has to be visible for \c running to get \c{true}. This - signal is useful for displaying splash screen while viewer is getting - initialized. + presentation is ready to be shown. */ static bool engineCleanerRegistered = false; @@ -181,6 +187,16 @@ bool Q3DSStudio3DItem::isRunning() const return m_running; } +/*! + \qmlproperty string Studio3D::error + + Contains the text for the error message that was generated during the + loading of the presentation. When no error occurred or there is no + presentation loaded, the value is an empty string. + + This property is read-only. +*/ + QString Q3DSStudio3DItem::error() const { return m_error; diff --git a/src/imports/studio3d/q3dssubpresentationsettings.cpp b/src/imports/studio3d/q3dssubpresentationsettings.cpp index e8ffcea..44d9e43 100644 --- a/src/imports/studio3d/q3dssubpresentationsettings.cpp +++ b/src/imports/studio3d/q3dssubpresentationsettings.cpp @@ -83,6 +83,27 @@ QQmlListProperty<Q3DSInlineQmlSubPresentation> Q3DSSubPresentationSettings::qmlS } } \endqml + + \section2 Linking to the Presentation via presentationId + + In Qt 3D Studio presentations QML sub-presentations are specified in the \e + assets element of the presentation's \c{.uia} file. This is important also + when using SubPresentationSettings and QmlStream. + + \badcode + <assets ...> + <presentation-qml id="presentation-id" args="preview-presentation.qml" /> + </assets> + \endcode + + \note the Qt 3D Studio application takes care of generating the \c{.uia} + file based on what the designers have set in the Sub-presentations dialog. + + The \c presentation-id attribute must contain a unique ID for the + sub-presentation. The corresponding \l QmlStream must provide the same + value in its presentationId property. The \c args attribute may contain an + optional preview version of the item, which is only used in the Viewer + application. */ /*! @@ -97,36 +118,27 @@ QQmlListProperty<Q3DSInlineQmlSubPresentation> Q3DSSubPresentationSettings::qmlS \ingroup 3dstudioruntime2 \brief QML stream. - This type allows attaching QML sub-presentation with a quick item. The item is rendered to a - texture and used as a part of a Qt 3D Studio presentation. - - The sub-presentation element must be specified in the \e assets element of the presentation - .uia file: - - \badcode - <assets ...> - <presentation-qml id="presentation-id" args="preview-presentation.qml" /> - </assets> - \endcode + This type allows specifying the contents of a QML sub-presentation within + the Studio3D item. QmlStream must be used in combination with + \l SubPresentationSettings. - The \c presentation-id attribute must contain a unique ID of the sub-presentation. - The \c args attribute may contain an optional preview version of the item, which is only - used in the Viewer application. + \sa SubPresentationSettings */ /*! \qmlproperty string QmlStream::presentationId - Holds the string ID of the sub-presentation the item is attached to. The id must be one of - the \c presentation-qml IDs specified in the .uia file. + Holds the string ID of the sub-presentation the contents of which is + specified by \l item. The id must be one of the \c presentation-qml IDs + specified in the \c{.uia} file. */ /*! \qmlproperty Item QmlStream::item - Holds the item attached to the sub-presentation. The item size is used as the the size of the - texture the item is rendered to. Default values \c{(256, 256)} are used if the item doesn't - specify a size. + Holds the item attached to the sub-presentation. The item size is used as + the the size of the texture the item is rendered to. A default value of + \c{(128, 128)} is used when the item does not specify a size. */ QT_END_NAMESPACE |