summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-04-23 16:38:54 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-04-27 07:33:12 +0000
commit7ce5b5a07b838b42d88f333e6155b60a4b63e608 (patch)
tree130463d96be8ccfb66bd6773fe2910dee2fe07d8 /examples
parent1883b1af29f56d2d998774fbef3765629db602b0 (diff)
Add getAttribute to Q3DSElement for API symmetry
We added it everywhere elso too, even where it was missing in 1.x, so have it here too. And add something to the example. Change-Id: Ie82ee80807384f9cc1f00064af5e593f3f534ca6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/3dstudioruntime2/simpleqml/main.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/3dstudioruntime2/simpleqml/main.qml b/examples/3dstudioruntime2/simpleqml/main.qml
index 70a1a73..a79c183 100644
--- a/examples/3dstudioruntime2/simpleqml/main.qml
+++ b/examples/3dstudioruntime2/simpleqml/main.qml
@@ -90,6 +90,14 @@ Rectangle {
onCurrentSlideIndexChanged: console.log("Current slide index for 'Scene': " + currentSlideIndex)
onCurrentSlideNameChanged: console.log("Current slide name for 'Scene': " + currentSlideName)
}
+
+ // Exercise Element a bit. This is no different from using the
+ // functions on Presentations, just avoids the need to specify the
+ // name/path repeatedly.
+ Element {
+ id: barrelRef
+ elementPath: "Barrel" // or Scene.Layer.Barrel but as long as it's unique the name's good enough
+ }
}
ignoredEvents: mouseEvCb.checked ? Studio3D.EnableAllEvents : (Studio3D.IgnoreMouseEvents | Studio3D.IgnoreWheelEvents)
onRunningChanged: console.log("running: " + s3d.running)
@@ -114,6 +122,13 @@ Rectangle {
}
}
+ Timer {
+ interval: 2000
+ running: true
+ repeat: true
+ onTriggered: console.log("Barrel rotation is " + barrelRef.getAttribute("rotation"))
+ }
+
NumberAnimation on opacity {
id: opacityAnimation
from: 1