diff options
author | Määttä Antti <antti.maatta@qt.io> | 2017-11-22 13:02:01 +0200 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2017-11-23 08:25:50 +0000 |
commit | 0571cb18a8adde98fb411cd13a69ed6f97dcd933 (patch) | |
tree | de975ea47fb22da3b1afd66b9ad3efc3f87d349b | |
parent | 77d7e220dafbf8a76e26a0dbe87c7fbe9bf5b07b (diff) |
Rename Qt3DSBehavior to Behavior
Change-Id: I03591ac08b41772f11dd3d32bba4bdaa20d47ce7
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | Studio/Content/Behavior Library/CameraLookAt.qml | 2 | ||||
-rw-r--r-- | Studio/Content/Behavior Library/CopyTransform.qml | 2 | ||||
-rw-r--r-- | doc/src/05-runtime/1-event-processing.qdoc | 2 | ||||
-rw-r--r-- | doc/src/06-qml-reference/Behavior.qdoc (renamed from doc/src/06-qml-reference/Qt3DSBehavior.qdoc) | 51 | ||||
-rw-r--r-- | doc/src/06-qml-reference/qml-index.qdoc | 2 | ||||
-rw-r--r-- | src/Runtime/Source/Runtime/Source/Qt3DSQmlEngine.cpp | 2 |
6 files changed, 31 insertions, 30 deletions
diff --git a/Studio/Content/Behavior Library/CameraLookAt.qml b/Studio/Content/Behavior Library/CameraLookAt.qml index 2986fde8..a4e1fffc 100644 --- a/Studio/Content/Behavior Library/CameraLookAt.qml +++ b/Studio/Content/Behavior Library/CameraLookAt.qml @@ -58,7 +58,7 @@ import QtStudio3D.Behavior 1.0 -Qt3DSBehavior { +Behavior { //External: property string cameraTarget property bool startImmediately diff --git a/Studio/Content/Behavior Library/CopyTransform.qml b/Studio/Content/Behavior Library/CopyTransform.qml index 96558372..451525b3 100644 --- a/Studio/Content/Behavior Library/CopyTransform.qml +++ b/Studio/Content/Behavior Library/CopyTransform.qml @@ -88,7 +88,7 @@ import QtStudio3D.Behavior 1.0 -Qt3DSBehavior { +Behavior { //External: property string targetObject property bool offsetMode diff --git a/doc/src/05-runtime/1-event-processing.qdoc b/doc/src/05-runtime/1-event-processing.qdoc index 6bf57259..73f613e1 100644 --- a/doc/src/05-runtime/1-event-processing.qdoc +++ b/doc/src/05-runtime/1-event-processing.qdoc @@ -95,7 +95,7 @@ runtime, a piece of logic gets created representing this action. When the onSelect event is fired and later processed, the interested logic will be notified and the slide change will occur. -\note Behavior event registrations (created with \l {Qt3DSBehavior}{QML Behavior} +\note Behavior event registrations (created with \l {Behavior}{QML Behavior} registerForEvent) work similarly to the logic described above. If a behavior registers explicitly for a certain event and in the handler calls goToSlide, essentially the same things happen. diff --git a/doc/src/06-qml-reference/Qt3DSBehavior.qdoc b/doc/src/06-qml-reference/Behavior.qdoc index a40602d2..da14c638 100644 --- a/doc/src/06-qml-reference/Qt3DSBehavior.qdoc +++ b/doc/src/06-qml-reference/Behavior.qdoc @@ -26,12 +26,13 @@ ****************************************************************************/ /*! - \qmltype Qt3DSBehavior - \brief Behavior Integration + \qmltype Behavior + \brief Technology Preview Behavior Integration - Qt 3D Studio supports writing custom behavior scripts using QML. It enables - interacting with the runtime using the Qt3DSBehavior QML class exposed to each - behavior script. + This is a technology preview (API may change in upcoming version) of how + Qt 3D Studio could support writing custom behavior scripts using QML and + JavaScript. It enables interacting with the runtime using the Behavior + QML class exposed to each behavior script. In QML behavior script, the integration to Qt 3D Studio is established by using the metadata tag system similar to the \l {file-formats-effects.html}{effect} @@ -53,9 +54,9 @@ import QtStudio3D.Behavior 1.0 \endcode - Finally, the Qt3DSBehavior type needs to be implemented in the qml script. + Finally, the Behavior type needs to be implemented in the qml script. \badcode -Qt3DSBehavior { +Behavior { id: mybehavior function onInitialize() { @@ -83,93 +84,93 @@ Qt3DSBehavior { */ /*! - \qmlmethod float Qt3DSBehavior::getDeltaTime() + \qmlmethod float Behavior::getDeltaTime() Returns the delta time between this and previous frame in milliseconds. */ /*! - \qmlmethod float Qt3DSBehavior::getAttribute(string attribute) + \qmlmethod float Behavior::getAttribute(string attribute) Returns the value of the given \a attribute. */ /*! - \qmlmethod void Qt3DSBehavior::setAttribute(string attribute, var value) + \qmlmethod void Behavior::setAttribute(string attribute, var value) Sets the \a value of the given \a attribute. */ /*! - \qmlmethod void Qt3DSBehavior::setAttribute(string handle, string attribute, var value) + \qmlmethod void Behavior::setAttribute(string handle, string attribute, var value) Sets the \a value of the given \a attribute for a given \a handle. */ /*! - \qmlmethod void Qt3DSBehavior::fireEvent(string event) + \qmlmethod void Behavior::fireEvent(string event) Fires the given \a event. */ /*! - \qmlmethod void Qt3DSBehavior::registerForEvent(string event, QJSValue function) + \qmlmethod void Behavior::registerForEvent(string event, QJSValue function) Registers the script for an \a event with the handler \a function. */ /*! - \qmlmethod void Qt3DSBehavior::registerForEvent(string handle, string event, QJSValue function) + \qmlmethod void Behavior::registerForEvent(string handle, string event, QJSValue function) Registers the script for an \a event with the handler \a function for a given \a handle. */ /*! - \qmlmethod void Qt3DSBehavior::unregisterForEvent(string event) + \qmlmethod void Behavior::unregisterForEvent(string event) Unregisters the script from an \a event. */ /*! - \qmlmethod void Qt3DSBehavior::unregisterForEvent(string handle, string event) + \qmlmethod void Behavior::unregisterForEvent(string handle, string event) Unregisters the script from an \a event for a given \a handle. */ /*! - \qmlmethod vector2d Qt3DSBehavior::getMousePosition() + \qmlmethod vector2d Behavior::getMousePosition() Returns the current position of the mouse in presentation coordinates. */ /*! - \qmlmethod matrix4 Qt3DSBehavior::calculateGlobalTransform(string handle) + \qmlmethod matrix4 Behavior::calculateGlobalTransform(string handle) Returns the current global transformation of the element specified by the \a handle or parent element if the handle is empty string. */ /*! - \qmlmethod vector3d Qt3DSBehavior::lookAt(vector3d target) + \qmlmethod vector3d Behavior::lookAt(vector3d target) Returns the rotation angles of the look at \a target. */ /*! - \qmlmethod string Qt3DSBehavior::getParent(string handle) + \qmlmethod string Behavior::getParent(string handle) Returns the parent of the given \a handle or parent element if the handle is empty string. */ /*! - \qmlmethod vector3d Qt3DSBehavior::matrixToEuler(matrix4 matrix) + \qmlmethod vector3d Behavior::matrixToEuler(matrix4 matrix) Returns the euler angles extracted from the \a matrix rotations. */ /*! - \qmlsignal void Qt3DSBehavior::onInitialize() + \qmlsignal void Behavior::onInitialize() This signal is emitted when the script becomes active the first time. If multiple behaviors match this, the signal for parent elements will @@ -179,7 +180,7 @@ Qt3DSBehavior { */ /*! - \qmlsignal void Qt3DSBehavior::onActivate() + \qmlsignal void Behavior::onActivate() This signal is emitted when the script becomes active. Any behaviors which were not active last frame that are active @@ -189,7 +190,7 @@ Qt3DSBehavior { */ /*! - \qmlsignal void Qt3DSBehavior::onDeactivate() + \qmlsignal void Behavior::onDeactivate() This signal is emitted when the script becomes inactive. Any behaviors which were active last frame that are not active @@ -199,7 +200,7 @@ Qt3DSBehavior { */ /*! - \qmlsignal void Qt3DSBehavior::onUpdate() + \qmlsignal void Behavior::onUpdate() This signal is emitted on each frame when the script is active. Any behaviors that are active this frame will have their diff --git a/doc/src/06-qml-reference/qml-index.qdoc b/doc/src/06-qml-reference/qml-index.qdoc index fb1f4a3a..e8b690ff 100644 --- a/doc/src/06-qml-reference/qml-index.qdoc +++ b/doc/src/06-qml-reference/qml-index.qdoc @@ -46,7 +46,7 @@ import QtStudio3D 1.0 \section1 QML Behavior Script -\l Qt3DSBehavior +\l Behavior \section1 Additional Information diff --git a/src/Runtime/Source/Runtime/Source/Qt3DSQmlEngine.cpp b/src/Runtime/Source/Runtime/Source/Qt3DSQmlEngine.cpp index 7f983a56..5fa4f4ab 100644 --- a/src/Runtime/Source/Runtime/Source/Qt3DSQmlEngine.cpp +++ b/src/Runtime/Source/Runtime/Source/Qt3DSQmlEngine.cpp @@ -460,7 +460,7 @@ CQmlEngineImpl::CQmlEngineImpl(NVFoundationBase &fnd, ITimeProvider &) ForwardingAllocator(fnd.getAllocator(), "CQmlEngineImpl::m_EmitSignalDataList")) , mRefCount(0) { - qmlRegisterType<Q3DSQmlBehavior>("QtStudio3D.Behavior", 1, 0, "Qt3DSBehavior"); + qmlRegisterType<Q3DSQmlBehavior>("QtStudio3D.Behavior", 1, 0, "Behavior"); } void CQmlEngineImpl::Shutdown(qt3ds::NVFoundationBase &inFoundation) |