summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-05-14 15:53:51 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-05-14 15:02:13 +0000
commit36315ec254a1e3f32c52cbd821f21220b90447f3 (patch)
tree8f6156a47cf2555a635e985e3465c9b3c9a6c41b /tests
parent8904cc5795b31d82b0bb4e4032db95536dbe1817 (diff)
Make calling Q3DS::surfaceFormat() optional for Studio3D
Our standard pattern is to expect applications to call QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); after creating the Q(Gui)Application, in order to ensure all OpenGL stuff and Qt Quick uses the format the runtime has determined to be ideal. With Studio3D however this is not always feasible - the Qt Quick scene may be hosted in an application that knows nothing about 3D and surface format gotchas. Therefore, make Studio3D force using the QQuickWindow's format() in case it is different from the ideal one. (if there was a setDefaultFormat(), as recommended, then the version/profile would match). At the same time drop Q3DSEngine::surfaceFormat() as an API on Q3DSEngine. There is no need for this (there's always the public Q3DS::surfaceFormat()) and not having this makes future steps towards getting rid of the globals easier. Task-number: QT3DS-1645 Change-Id: I43e8c0da4aa17e03eb2c49755eb064dd2dc3d0ce Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/behaviors/tst_q3dsbehaviors.cpp2
-rw-r--r--tests/auto/documents/tst_q3dsdocuments.cpp2
-rw-r--r--tests/auto/q3dslancelot/scenegrabber/main.cpp2
-rw-r--r--tests/auto/slideplayer/tst_q3dsslideplayer.cpp2
-rw-r--r--tests/auto/slides/tst_q3dsslides.cpp2
-rw-r--r--tests/manual/qt3dsexplorer/main.cpp2
6 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/behaviors/tst_q3dsbehaviors.cpp b/tests/auto/behaviors/tst_q3dsbehaviors.cpp
index fdc8da5..9954c77 100644
--- a/tests/auto/behaviors/tst_q3dsbehaviors.cpp
+++ b/tests/auto/behaviors/tst_q3dsbehaviors.cpp
@@ -69,7 +69,7 @@ void tst_Q3DSBehaviors::initTestCase()
if (!isOpenGLGoodEnough())
QSKIP("This platform does not support OpenGL proper");
- QSurfaceFormat::setDefaultFormat(Q3DSEngine::surfaceFormat());
+ QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
m_engine = new Q3DSEngine;
m_view = new Q3DSWindow;
m_view->setEngine(m_engine);
diff --git a/tests/auto/documents/tst_q3dsdocuments.cpp b/tests/auto/documents/tst_q3dsdocuments.cpp
index 61af29e..aee400d 100644
--- a/tests/auto/documents/tst_q3dsdocuments.cpp
+++ b/tests/auto/documents/tst_q3dsdocuments.cpp
@@ -113,7 +113,7 @@ void tst_Q3DSDocuments::initTestCase()
if (!isOpenGLGoodEnough())
QSKIP("This platform does not support OpenGL proper");
- QSurfaceFormat::setDefaultFormat(Q3DSEngine::surfaceFormat());
+ QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
Q3DSUtils::setDialogsEnabled(false);
}
diff --git a/tests/auto/q3dslancelot/scenegrabber/main.cpp b/tests/auto/q3dslancelot/scenegrabber/main.cpp
index 357b257..6246746 100644
--- a/tests/auto/q3dslancelot/scenegrabber/main.cpp
+++ b/tests/auto/q3dslancelot/scenegrabber/main.cpp
@@ -150,7 +150,7 @@ int main(int argc, char *argv[])
qSetGlobalQHashSeed(0);
QGuiApplication a(argc, argv);
- QSurfaceFormat::setDefaultFormat(Q3DSEngine::surfaceFormat());
+ QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
Q3DSUtils::setDialogsEnabled(false);
diff --git a/tests/auto/slideplayer/tst_q3dsslideplayer.cpp b/tests/auto/slideplayer/tst_q3dsslideplayer.cpp
index 3593646..96fa78b 100644
--- a/tests/auto/slideplayer/tst_q3dsslideplayer.cpp
+++ b/tests/auto/slideplayer/tst_q3dsslideplayer.cpp
@@ -101,7 +101,7 @@ void tst_Q3DSSlidePlayer::initTestCase()
if (!isOpenGLGoodEnough())
QSKIP("This platform does not support OpenGL proper");
- QSurfaceFormat::setDefaultFormat(Q3DSEngine::surfaceFormat());
+ QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
m_engine = new Q3DSEngine;
m_view = new Q3DSWindow;
m_view->setEngine(m_engine);
diff --git a/tests/auto/slides/tst_q3dsslides.cpp b/tests/auto/slides/tst_q3dsslides.cpp
index cc6a62b..f68835a 100644
--- a/tests/auto/slides/tst_q3dsslides.cpp
+++ b/tests/auto/slides/tst_q3dsslides.cpp
@@ -133,7 +133,7 @@ void tst_Q3DSSlides::initTestCase()
if (!isOpenGLGoodEnough())
QSKIP("This platform does not support OpenGL proper");
- QSurfaceFormat::setDefaultFormat(Q3DSEngine::surfaceFormat());
+ QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
m_engine = new Q3DSEngine;
m_view = new Q3DSWindow;
m_view->setEngine(m_engine);
diff --git a/tests/manual/qt3dsexplorer/main.cpp b/tests/manual/qt3dsexplorer/main.cpp
index e90ecda..0e2b793 100644
--- a/tests/manual/qt3dsexplorer/main.cpp
+++ b/tests/manual/qt3dsexplorer/main.cpp
@@ -38,7 +38,7 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QSurfaceFormat::setDefaultFormat(Q3DSEngine::surfaceFormat());
+ QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
QCommandLineParser cmdLineParser;
cmdLineParser.addHelpOption();