diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-01-15 17:32:44 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-01-26 06:56:23 +0000 |
commit | 1961ff954c4df4a437bb0e9375fd8bdcb643a88a (patch) | |
tree | 34976069f2d3a106723ac9fbd4a9ba1fffcb5566 /tests | |
parent | 260ca381faddc1010ab079900e178cdbf2b5482c (diff) |
Add QML type and C++ class for data input
QML type is DataInput. C++ class is Q3DSDataInput.
Task-number: QT3DS-387
Change-Id: I7f871ae3e1149adee7859fdb8f844e8f90837264
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'tests')
4 files changed, 54 insertions, 0 deletions
diff --git a/tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp b/tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp index ef3cb942..40cbe210 100644 --- a/tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp +++ b/tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp @@ -82,6 +82,8 @@ private slots: void testElement(); void testMouseInput_data(); void testMouseInput(); + void testDataInput_data(); + void testDataInput(); private: QWindow *createWindow(const QSize &size); @@ -1472,6 +1474,25 @@ void tst_Q3DSSurfaceViewer::testMouseInput() // Note: No way yet to hook mouse move into anything in the presentation } +void tst_Q3DSSurfaceViewer::testDataInput_data() +{ + testBasics_data(); +} + +void tst_Q3DSSurfaceViewer::testDataInput() +{ +// QFETCH(bool, isWindow); + +// if (isWindow) +// createWindowAndViewer(m_viewer, DATAINPUT); +// else +// createOffscreenAndViewer(m_viewer, DATAINPUT); + + // TODO: This is a placeholder for data input test. To be finished when proper support + // for changing animation time via data inputs is supported and the display bugs fixed. + // See: https://bugreports.qt.io/browse/QT3DS-854 +} + QTEST_MAIN(tst_Q3DSSurfaceViewer) diff --git a/tests/auto/studio3d/shared/presentation/datainput.uip b/tests/auto/studio3d/shared/presentation/datainput.uip new file mode 100644 index 00000000..e2464527 --- /dev/null +++ b/tests/auto/studio3d/shared/presentation/datainput.uip @@ -0,0 +1,31 @@ +<?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" > + <Layer id="Layer" > + <Camera id="Camera" /> + <Light id="Light" /> + <Text id="Text" /> + <Text id="Text2" /> + </Layer> + <DataInput id="MyDataInput" name="MyDataInput" controlledelemprop="Scene.Layer.Text textstring " /> + </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="#Text" name="Text" font="TitilliumWeb-Regular" position="-0.000391006 46.1884 0" scale="1.0 1.0 1.0" size="48" textstring="Datainput value goes here" /> + <Add ref="#Text2" name="Text2" font="TitilliumWeb-Regular" position="2.88678 207.846 0" scale="1 1 1" size="48" textstring="Text via DataInput:" /> + <Add ref="#MyDataInput" name="MyDataInput" /> + </State> + </State> + </Logic> + </Project> +</UIP> diff --git a/tests/auto/studio3d/shared/shared_presentations.h b/tests/auto/studio3d/shared/shared_presentations.h index c778b453..b1d23e0e 100644 --- a/tests/auto/studio3d/shared/shared_presentations.h +++ b/tests/auto/studio3d/shared/shared_presentations.h @@ -36,3 +36,4 @@ const QUrl ANIMATION = QUrl(QStringLiteral("qrc:/animation.uip")); const QUrl SETTINGS = QUrl(QStringLiteral("qrc:/settings.uip")); const QUrl MULTISLIDE = QUrl(QStringLiteral("qrc:/multislide.uip")); const QUrl MOUSE = QUrl(QStringLiteral("qrc:/mouse.uip")); +const QUrl DATAINPUT = QUrl(QStringLiteral("qrc:/datinput.uip")); diff --git a/tests/auto/studio3d/shared/shared_presentations.qrc b/tests/auto/studio3d/shared/shared_presentations.qrc index a68dae72..00877c26 100644 --- a/tests/auto/studio3d/shared/shared_presentations.qrc +++ b/tests/auto/studio3d/shared/shared_presentations.qrc @@ -8,5 +8,6 @@ <file alias="settings.uip">presentation/settings.uip</file> <file alias="multislide.uip">presentation/multislide.uip</file> <file alias="mouse.uip">presentation/mouse.uip</file> + <file alias="datainput.uip">presentation/datainput.uip</file> </qresource> </RCC> |