diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/runtime/runtime.pro | 2 | ||||
-rw-r--r-- | tests/auto/viewer/tst_qt3dsviewer.cpp | 30 | ||||
-rw-r--r-- | tests/auto/viewer/tst_qt3dsviewer.h | 1 | ||||
-rw-r--r-- | tests/auto/viewer/viewer.pro | 2 | ||||
-rw-r--r-- | tests/scenes/simple_cube_animation/presentations/simple_cube_animation.uip | 4 |
5 files changed, 36 insertions, 3 deletions
diff --git a/tests/auto/runtime/runtime.pro b/tests/auto/runtime/runtime.pro index 8f4451ed..534af9f8 100644 --- a/tests/auto/runtime/runtime.pro +++ b/tests/auto/runtime/runtime.pro @@ -1,6 +1,6 @@ TEMPLATE = app CONFIG += testcase -include($$PWD/../../../src/Runtime/commoninclude.pri) +include($$PWD/../../../src/Runtime/ogl-runtime/commoninclude.pri) TARGET = tst_qt3dsruntime QT += testlib gui diff --git a/tests/auto/viewer/tst_qt3dsviewer.cpp b/tests/auto/viewer/tst_qt3dsviewer.cpp index 97429039..9424612e 100644 --- a/tests/auto/viewer/tst_qt3dsviewer.cpp +++ b/tests/auto/viewer/tst_qt3dsviewer.cpp @@ -593,6 +593,36 @@ void tst_qt3dsviewer::testCreateMesh() QTest::qWait(200); // Extra wait to verify slide change visually } +void tst_qt3dsviewer::testMouseEvents() +{ + m_viewer->show(); + QTest::qWait(1000); + + QSignalSpy spyEvents(m_studio3DItem, + SIGNAL(ignoredEventsChanged())); + QSignalSpy spyExited(m_presentation, + SIGNAL(slideExited(const QString &, unsigned int, const QString &))); + + QCOMPARE(spyEvents.count(), 0); + QCOMPARE(spyExited.count(), 0); + + // Ignore mouse, so slide doesn't change + m_studio3DItem->setProperty("ignoredEvents", 1); + QTest::mousePress(m_viewer, Qt::LeftButton); + QTest::qWait(1000); + QTest::mouseRelease(m_viewer, Qt::LeftButton); + QCOMPARE(spyEvents.count(), 1); + QCOMPARE(spyExited.count(), 0); + + // Enable mouse, clicking switches slide + m_studio3DItem->setProperty("ignoredEvents", 0); + QTest::mousePress(m_viewer, Qt::LeftButton); + QTest::qWait(1000); + QTest::mouseRelease(m_viewer, Qt::LeftButton); + QCOMPARE(spyEvents.count(), 2); + QCOMPARE(spyExited.count(), 1); +} + void tst_qt3dsviewer::deleteCreated() { m_presentation->deleteElements(m_createdElements); diff --git a/tests/auto/viewer/tst_qt3dsviewer.h b/tests/auto/viewer/tst_qt3dsviewer.h index e6fae709..3d1f9473 100644 --- a/tests/auto/viewer/tst_qt3dsviewer.h +++ b/tests/auto/viewer/tst_qt3dsviewer.h @@ -58,6 +58,7 @@ private Q_SLOTS: void testCreateElement(); void testCreateMaterial(); void testCreateMesh(); + void testMouseEvents(); private: void deleteCreated(); diff --git a/tests/auto/viewer/viewer.pro b/tests/auto/viewer/viewer.pro index ad832e02..9e06c2ca 100644 --- a/tests/auto/viewer/viewer.pro +++ b/tests/auto/viewer/viewer.pro @@ -1,6 +1,6 @@ TEMPLATE = app CONFIG += testcase -include($$PWD/../../../src/Runtime/commoninclude.pri) +include($$PWD/../../../src/Runtime/ogl-runtime/commoninclude.pri) TARGET = tst_qt3dsviewer QT += testlib gui quick studio3d diff --git a/tests/scenes/simple_cube_animation/presentations/simple_cube_animation.uip b/tests/scenes/simple_cube_animation/presentations/simple_cube_animation.uip index fc273121..f8fae907 100644 --- a/tests/scenes/simple_cube_animation/presentations/simple_cube_animation.uip +++ b/tests/scenes/simple_cube_animation/presentations/simple_cube_animation.uip @@ -32,7 +32,9 @@ <AnimationTrack property="position.z" type="EaseInOut" >0 0 100 100 5 0 100 100</AnimationTrack> </Add> <State id="Scene-Slide1" name="Slide1" playmode="Play Through To..." > - <Set ref="#Layer" endtime="5000" /> + <Set ref="#Layer" endtime="5000" > + <Action id="Layer-Action" eyeball="True" triggerObject="#Scene" event="onPressureDown" targetObject="#Scene" handler="Next Slide" /> + </Set> <Set ref="#Camera" endtime="5000" /> <Set ref="#Light" endtime="5000" /> <Add ref="#Sphere" name="Sphere" endtime="5000" scale="0.1 0.1 0.1" sourcepath="#Sphere" /> |