summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJari Karppinen <jari.karppinen@qt.io>2019-06-27 08:04:50 +0300
committerJari Karppinen <jari.karppinen@qt.io>2019-06-27 08:05:19 +0300
commit427bf6fac383f066a1378679a88546b16f156c7e (patch)
treeb4159550ca38aa0fad1bf5f47ed12911e3be91fa
parent1293f9cc04861e12f360af3c0c7ba94f0efc8dbb (diff)
Update qmldatainput example
Editor shows mismatched data type warning for colorInput, since colors are Vector4 instead of Vector3 now. Suppress the warning by correcting the data input type in .uia file. Furthermore the QML code is updated to use Vector4 and PropertyAnimation instead of Vector3dAnimation to pass in the values from QML. Change-Id: I0e0370dab139a5ebea00404035774c99e3d8ea82 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--examples/studio3d/qmldatainput/presentation/datainput.uia2
-rw-r--r--examples/studio3d/qmldatainput/presentation/datainput.uip2
-rw-r--r--examples/studio3d/qmldatainput/qml/qmldatainput/main.qml12
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/studio3d/qmldatainput/presentation/datainput.uia b/examples/studio3d/qmldatainput/presentation/datainput.uia
index 30d0084..3c4bb08 100644
--- a/examples/studio3d/qmldatainput/presentation/datainput.uia
+++ b/examples/studio3d/qmldatainput/presentation/datainput.uia
@@ -3,7 +3,7 @@
<assets initial="datainput">
<presentation id="datainput" src="datainput.uip"/>
<dataInput name="cameraRotInput" type="Vector3"/>
- <dataInput name="colorInput" type="Vector3"/>
+ <dataInput name="colorInput" type="Vector4"/>
<dataInput name="queriedInput" type="String"/>
<dataInput name="rangeInput" type="Ranged Number" min="0" max="360"/>
<dataInput name="scaleInput" type="Vector3"/>
diff --git a/examples/studio3d/qmldatainput/presentation/datainput.uip b/examples/studio3d/qmldatainput/presentation/datainput.uip
index 008f456..fefc615 100644
--- a/examples/studio3d/qmldatainput/presentation/datainput.uip
+++ b/examples/studio3d/qmldatainput/presentation/datainput.uip
@@ -37,7 +37,7 @@
<State name="Master Slide" component="#Scene" >
<Add ref="#Layer" multisampleaa="SSAA" progressiveaa="8x" />
<Add ref="#Camera" controlledproperty="$cameraRotInput rotation" pivot="0 0 0" position="0 0 -800" rotation="0 0 0" />
- <Add ref="#Light" castshadow="True" controlledproperty="$colorInput lightdiffuse" lightdiffuse="1 0 0" lighttype="Point" position="-300.444 70.829 -30" shdwfactor="11.89" shdwfilter="6.94" shdwmapres="11" />
+ <Add ref="#Light" castshadow="True" controlledproperty="$colorInput lightdiffuse" lightdiffuse="1 0 0 1" lighttype="Point" position="-300.444 70.829 -30" shdwfactor="11.89" shdwfilter="6.94" shdwmapres="11" />
<State id="Scene-Slide1" name="Slide1" initialplaystate="Pause" >
<Add ref="#Text" name="Text" controlledproperty="$stringInput textstring" font="TitilliumWeb-Regular" position="216.513 76.6172 -113.498" scale="1 1 1" size="24" textstring="0" >
<AnimationTrack property="rotation.x" type="EaseInOut" >0 0 0 0 10 0 0 0</AnimationTrack>
diff --git a/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml b/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml
index ab50796..8267b01 100644
--- a/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml
+++ b/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml
@@ -107,7 +107,7 @@ Item {
width: 1280
property real inputNumber: 0
- property vector3d inputColorVec3: Qt.vector3d(0, 0, 0)
+ property vector4d inputColorVec4: Qt.vector4d(0, 0, 0, 1)
property vector3d inputCamRotVec3: Qt.vector3d(0, 0, 0)
property vector3d inputScaleVec3: Qt.vector3d(0, 0, 0)
property string inputString: ""
@@ -136,12 +136,12 @@ Item {
loops: Animation.Infinite
running: true
}
- Vector3dAnimation {
+ PropertyAnimation {
target: studio3D
- property: "inputColorVec3"
+ property: "inputColorVec4"
duration: 6000
- from: Qt.vector3d(0.1, 0.1, 0.3)
- to: Qt.vector3d(1.0, 0.5, 1.0)
+ from: Qt.vector4d(0.1, 0.1, 0.3, 1.0)
+ to: Qt.vector4d(1.0, 0.5, 1.0, 1.0)
loops: Animation.Infinite
running: true
}
@@ -190,7 +190,7 @@ Item {
}
DataInput {
name: "colorInput"
- value: studio3D.inputColorVec3
+ value: studio3D.inputColorVec4
}
DataInput {
name: "cameraRotInput"