summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-04-23 14:11:02 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-04-27 07:33:10 +0000
commit1883b1af29f56d2d998774fbef3765629db602b0 (patch)
tree9cbe933afd439a5c1e9b00a0c3a31dc02228b561 /examples
parenta9cf1369eceff85632b53de012f7f2d49dfeb4d2 (diff)
Add Q3DSSceneElement
Exposed to QML as SceneElement. "Conveniently" duplicates more stuff from Q3DSPresentation. Go figure. Task-number: QT3DS-1014 Change-Id: Id3af13592cbddafd2081a0eae50fb2dd4c2f3229 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/3dstudioruntime2/simpleqml/main.qml28
1 files changed, 26 insertions, 2 deletions
diff --git a/examples/3dstudioruntime2/simpleqml/main.qml b/examples/3dstudioruntime2/simpleqml/main.qml
index 8dc46ff..70a1a73 100644
--- a/examples/3dstudioruntime2/simpleqml/main.qml
+++ b/examples/3dstudioruntime2/simpleqml/main.qml
@@ -83,6 +83,13 @@ Rectangle {
name: "di_text"
value: s3d.textValue
}
+
+ SceneElement {
+ id: sceneElementForScene
+ elementPath: "Scene" // could also refer to a Component node instead
+ onCurrentSlideIndexChanged: console.log("Current slide index for 'Scene': " + currentSlideIndex)
+ onCurrentSlideNameChanged: console.log("Current slide name for 'Scene': " + currentSlideName)
+ }
}
ignoredEvents: mouseEvCb.checked ? Studio3D.EnableAllEvents : (Studio3D.IgnoreMouseEvents | Studio3D.IgnoreWheelEvents)
onRunningChanged: console.log("running: " + s3d.running)
@@ -211,19 +218,36 @@ Rectangle {
}
Button {
id: nextSlideByIndex
- text: "Next slide"
+ text: "Next slide (via pres., wrap)"
anchors.left: parent.left
anchors.bottom: fpsCount.top
onClicked: s3dpres.goToSlide("Scene", true, true)
focusPolicy: Qt.NoFocus
}
Button {
- text: "Seek to 5 seconds"
+ id: seekBtn
+ text: "Seek to 5 seconds (via pres.)"
anchors.left: nextSlideByIndex.right
anchors.bottom: fpsCount.top
onClicked: s3dpres.goToTime("Scene", 5)
focusPolicy: Qt.NoFocus
}
+ Button {
+ id: nextSlideViaSceneElement
+ text: "Next slide (via SceneElement, no wrap)"
+ anchors.left: seekBtn.right
+ anchors.bottom: fpsCount.top
+ onClicked: sceneElementForScene.currentSlideIndex += 1
+ focusPolicy: Qt.NoFocus
+ }
+ Button {
+ id: seekBtn2
+ text: "Seek to 5 seconds (via SceneElement)"
+ anchors.left: nextSlideViaSceneElement.right
+ anchors.bottom: fpsCount.top
+ onClicked: sceneElementForScene.goToTime(5)
+ focusPolicy: Qt.NoFocus
+ }
Button {
id: profTogBtn