diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-28 11:09:43 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-29 08:36:51 +0000 |
commit | a08ea9e071319286fe401cd58e7200c29603c8a1 (patch) | |
tree | 676d0887bb394c3686ea15f231600ef9180d0ca1 /tests | |
parent | 29f22c2e0444f00c62667437c64ccceb85d2951a (diff) |
Support Float as a data input type
Float is equivalent to RangedNumber with no min and max specified.
Change-Id: I6d7feaec660034f40a41d59547580a87710bcda0
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/uiaparser/data/datainput.uia | 1 | ||||
-rw-r--r-- | tests/auto/uiaparser/tst_q3dsuiaparser.cpp | 9 | ||||
-rw-r--r-- | tests/scenes/barrel/Barrel_datainput_norangetime.uia | 19 | ||||
-rw-r--r-- | tests/scenes/barrel/Barrel_datainput_norangetime.uip | 58 |
4 files changed, 86 insertions, 1 deletions
diff --git a/tests/auto/uiaparser/data/datainput.uia b/tests/auto/uiaparser/data/datainput.uia index ec9cdf7..5f657e3 100644 --- a/tests/auto/uiaparser/data/datainput.uia +++ b/tests/auto/uiaparser/data/datainput.uia @@ -5,6 +5,7 @@ <dataInput name="newDataInput" type="Ranged Number" min="0" max="10"/> <dataInput name="newDataInput_001" type="String"/> <dataInput name="newDataInput_002" type="Ranged Number" min="42" max="123.45"/> + <dataInput name="newDataInput_003" type="Float" /> </assets> <statemachine ref="#logic"> diff --git a/tests/auto/uiaparser/tst_q3dsuiaparser.cpp b/tests/auto/uiaparser/tst_q3dsuiaparser.cpp index 93401ba..11e47f6 100644 --- a/tests/auto/uiaparser/tst_q3dsuiaparser.cpp +++ b/tests/auto/uiaparser/tst_q3dsuiaparser.cpp @@ -114,12 +114,13 @@ void tst_Q3DSUiaParser::testDataInput() QCOMPARE(data.initialPresentationId, QStringLiteral("Barrel")); QCOMPARE(data.presentations.count(), 1); - QCOMPARE(data.dataInputEntries.count(), 3); + QCOMPARE(data.dataInputEntries.count(), 4); auto di = data.dataInputEntries; QVERIFY(di.contains(QStringLiteral("newDataInput"))); QVERIFY(di.contains(QStringLiteral("newDataInput_001"))); QVERIFY(di.contains(QStringLiteral("newDataInput_002"))); + QVERIFY(di.contains(QStringLiteral("newDataInput_003"))); auto diEntry = di[QStringLiteral("newDataInput")]; QCOMPARE(diEntry.name, QStringLiteral("newDataInput")); @@ -136,6 +137,12 @@ void tst_Q3DSUiaParser::testDataInput() QCOMPARE(diEntry.type, Q3DSDataInputEntry::TypeRangedNumber); QCOMPARE(diEntry.minValue, 42.0f); QCOMPARE(diEntry.maxValue, 123.45f); + + diEntry = di[QStringLiteral("newDataInput_003")]; + QCOMPARE(diEntry.name, QStringLiteral("newDataInput_003")); + QCOMPARE(diEntry.type, Q3DSDataInputEntry::TypeFloat); + QCOMPARE(diEntry.minValue, 0.0f); + QCOMPARE(diEntry.maxValue, 0.0f); } #include <tst_q3dsuiaparser.moc> diff --git a/tests/scenes/barrel/Barrel_datainput_norangetime.uia b/tests/scenes/barrel/Barrel_datainput_norangetime.uia new file mode 100644 index 0000000..3043ac4 --- /dev/null +++ b/tests/scenes/barrel/Barrel_datainput_norangetime.uia @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<application xmlns="http://qt.io/qt3dstudio/uia"> + <assets initial="Barrel_datainput"> + <presentation id="Barrel_datainput" src="Barrel_datainput_norangetime.uip"/> + <dataInput name="di_text" type="String"/> + <dataInput name="di_slide" type="String"/> + <dataInput name="di_time_float_not_ranged" type="Float" /> + </assets> + + <statemachine ref="#logic"> + <visual-states> + <state ref="Initial"> + <enter> + <goto-slide element="main:Scene" rel="next"/> + </enter> + </state> + </visual-states> + </statemachine> +</application> diff --git a/tests/scenes/barrel/Barrel_datainput_norangetime.uip b/tests/scenes/barrel/Barrel_datainput_norangetime.uip new file mode 100644 index 0000000..47a198a --- /dev/null +++ b/tests/scenes/barrel/Barrel_datainput_norangetime.uip @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP version="3" > + <Project > + <ProjectSettings author="" company="" presentationWidth="800" presentationHeight="480" maintainAspect="False" > + <CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors> + </ProjectSettings> + <Graph > + <Scene id="Scene" controlledproperty="di_slide @slide di_time_float_not_ranged @timeline" > + <Layer id="Layer" > + <Camera id="Camera" /> + <Light id="Light" /> + <Model id="Barrel" > + <Material id="Material" > + <Image id="Material_diffusemap" /> + <Image id="Material_normalmap" /> + <Image id="Material_emissivemap" /> + <Image id="Material_specularmap" /> + </Material> + </Model> + <Text id="Text" /> + <Text id="Text2" controlledproperty="di_text textstring" /> + </Layer> + </Scene> + </Graph> + <Logic > + <State name="Master Slide" component="#Scene" > + <Add ref="#Layer" /> + <Add ref="#Camera" /> + <Add ref="#Light" /> + <State id="Scene-Slide1" name="Slide1" playmode="Looping" > + <Add ref="#Barrel" name="Barrel" position="0 -42 -483" rotation="90 0 0" scale="100 100 100" sourcepath=".\barrel\meshes\Barrel.mesh#1" > + <AnimationTrack property="opacity" type="EaseInOut" /> + <AnimationTrack property="rotation.x" type="EaseInOut" >0 90 100 100 5 64 100 100 10 90 100 100</AnimationTrack> + <AnimationTrack property="rotation.y" type="EaseInOut" >0 0 100 100 5 -302 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 5 0 100 100 10 0 100 100</AnimationTrack> + </Add> + <Add ref="#Material" bumpamount="0" diffusemap="#Material_diffusemap" emissivemap="#Material_emissivemap" fresnelPower="25" normalmap="#Material_normalmap" specularamount="4" specularmap="#Material_specularmap" specularmodel="Default" specularroughness="0.001" > + <AnimationTrack property="bumpamount" type="EaseInOut" >0 0 100 100 5 1 100 100</AnimationTrack> + </Add> + <Add ref="#Material_diffusemap" sourcepath=".\maps\barrel_barrel_Diffuse.png" /> + <Add ref="#Material_normalmap" sourcepath=".\maps\barrel_barrel_Normal.png" /> + <Add ref="#Material_emissivemap" sourcepath=".\maps\barrel_barrel_Emissive.png" /> + <Add ref="#Material_specularmap" sourcepath=".\maps\barrel_barrel_Specular.png" /> + <Add ref="#Text" name="Text" font="Arimo-Regular" position="-486.418 297.128 50.5569" textcolor="0 1 0" textstring="Barrel!" tracking="0" > + <AnimationTrack property="opacity" type="EaseInOut" >0 100 100 100 5.009 43.75 100 100 10 100 100 100</AnimationTrack> + <AnimationTrack property="rotation.x" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="rotation.y" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 360 100 100</AnimationTrack> + <AnimationTrack property="rotation.z" type="EaseInOut" >0 0 100 100 4.997 0 100 100 5.009 0 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="textcolor.x" type="EaseInOut" >0 0 100 100 5.009 0.501961 100 100 10 0 100 100</AnimationTrack> + <AnimationTrack property="textcolor.y" type="EaseInOut" >0 1 100 100 5.009 0.235294 100 100 10 1 100 100</AnimationTrack> + <AnimationTrack property="textcolor.z" type="EaseInOut" >0 0 100 100 5.009 0.333333 100 100 10 0 100 100</AnimationTrack> + </Add> + <Add ref="#Text2" name="Text2" font="Arimo-Regular" position="-463.324 67.8387 0" /> + </State> + </State> + </Logic> + </Project> +</UIP> |