From 764924da8ab3255c1b8d1ad5b39f85675f4b855e Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Mon, 27 Apr 2020 11:56:17 +0100 Subject: Fix build for Qt6 - updated dependencies, excluding qtgamepad for now - fixed issues with Q_PROPERTY not supporting forward declarations - fixed for changes in QtQuick private API - fixed for changes in QtOpenGLVersionFunctions API - fixed for removal of QT_OPENGL_ES* macros - fixed for changes in QtConcurrent API - fixed RHI based build Change-Id: I42ccd2f101b7f0a78e2860c6d551722bf6710a11 Reviewed-by: Paul Lemire --- tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp | 2 +- tests/auto/quick3d/3dinput/3dinput.qml | 3 ++- .../tst_filtercompatibletechniquejob.cpp | 2 +- .../render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp | 5 +++-- .../opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp | 5 +++-- .../render/opengl/graphicshelpergl3_3/graphicshelpergl3_3.pro | 2 +- .../opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp | 5 +++-- .../render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp | 5 +++-- tests/auto/render/render.pro | 4 +--- .../shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp | 11 +++++++++++ tests/manual/boundingvolumes/main.cpp | 2 +- tests/manual/manual-renderloop/main.cpp | 2 +- tests/manual/qtbug-76766/main.cpp | 2 +- tests/manual/rendercapture-cpp/orbittransformcontroller.h | 5 +---- 14 files changed, 33 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp b/tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp index 6fcc2e637..e2917789e 100644 --- a/tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp +++ b/tests/auto/extras/qtext2dentity/tst_qtext2dentity.cpp @@ -77,7 +77,7 @@ private slots: void tst_qtext2dentity::checkChangeArbiter() { -#if !defined(QT_OPENGL_ES_2_ANGLE) +#if !QT_CONFIG(angle) // GIVEN Qt3DExtras::Quick::Qt3DQuickWindow view; view.setSource(QUrl("qrc:/qtext2dentity.qml")); diff --git a/tests/auto/quick3d/3dinput/3dinput.qml b/tests/auto/quick3d/3dinput/3dinput.qml index 9ae53f66a..b95a8d460 100644 --- a/tests/auto/quick3d/3dinput/3dinput.qml +++ b/tests/auto/quick3d/3dinput/3dinput.qml @@ -47,6 +47,7 @@ Item { QQ3Input20.AxisSetting {} //Qt3DInput::QAxisSetting QQ3Input20.AnalogAxisInput {} //Qt3DInput::QAnalogAxisInput QQ3Input20.ButtonAxisInput {} //Qt3DInput::QButtonAxisInput - QQ3Input20.GamepadInput {} //Qt3DInput::QGamepadInput + // Disabled for Qt 6 + // QQ3Input20.GamepadInput {} //Qt3DInput::QGamepadInput } diff --git a/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp b/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp index e5c34f804..7d897a358 100644 --- a/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp +++ b/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp @@ -179,7 +179,7 @@ private Q_SLOTS: void initTestCase() { QSurfaceFormat format; -#ifdef QT_OPENGL_ES_2 +#if QT_CONFIG(opengles2) format.setRenderableType(QSurfaceFormat::OpenGLES); #else if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { diff --git a/tests/auto/render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp b/tests/auto/render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp index 5a1d22283..f733697f7 100644 --- a/tests/auto/render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp +++ b/tests/auto/render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp @@ -33,13 +33,14 @@ #include #include #include +#include #include #include #include #include #include -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) #define TEST_SHOULD_BE_PERFORMED 1 @@ -153,7 +154,7 @@ private Q_SLOTS: return; } - if ((m_func = m_glContext.versionFunctions()) != nullptr) { + if ((m_func = QOpenGLVersionFunctionsFactory::get()) != nullptr) { if (m_glContext.hasExtension(QByteArrayLiteral("GL_ARB_framebuffer_object"))) { m_fboFuncs = new QOpenGLExtension_ARB_framebuffer_object(); m_fboFuncs->initializeOpenGLFunctions(); diff --git a/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp b/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp index 08c30dc15..e784e5b9a 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp @@ -32,12 +32,13 @@ #include #include #include +#include #include #include #include #include -#if !defined(QT_OPENGL_ES_2) && defined(QT_OPENGL_3_2) +#if !QT_CONFIG(opengles2) && defined(QT_OPENGL_3_2) #define TEST_SHOULD_BE_PERFORMED 1 @@ -207,7 +208,7 @@ private Q_SLOTS: return; } - if ((m_func = m_glContext.versionFunctions()) != nullptr) { + if ((m_func = QOpenGLVersionFunctionsFactory::get()) != nullptr) { m_glHelper.initializeHelper(&m_glContext, m_func); m_initializationSuccessful = true; } diff --git a/tests/auto/render/opengl/graphicshelpergl3_3/graphicshelpergl3_3.pro b/tests/auto/render/opengl/graphicshelpergl3_3/graphicshelpergl3_3.pro index 5ef0b6806..ae8e06eba 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_3/graphicshelpergl3_3.pro +++ b/tests/auto/render/opengl/graphicshelpergl3_3/graphicshelpergl3_3.pro @@ -2,7 +2,7 @@ TEMPLATE = app TARGET = tst_graphicshelpergl3_3 -QT += 3dcore 3dcore-private 3drender 3drender-private testlib +QT += 3dcore 3dcore-private 3drender 3drender-private testlib opengl CONFIG += testcase diff --git a/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp b/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp index b463e6236..7e2ca4aa0 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp @@ -32,11 +32,12 @@ #include #include #include +#include #include #include #include -#if !defined(QT_OPENGL_ES_2) && defined(QT_OPENGL_3_2) +#if !QT_CONFIG(opengles2) && defined(QT_OPENGL_3_2) #define TEST_SHOULD_BE_PERFORMED 1 @@ -207,7 +208,7 @@ private Q_SLOTS: return; } - if ((m_func = m_glContext.versionFunctions()) != nullptr) { + if ((m_func = QOpenGLVersionFunctionsFactory::get()) != nullptr) { m_glHelper.initializeHelper(&m_glContext, m_func); m_initializationSuccessful = true; } diff --git a/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp b/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp index 8f86f38ce..92a4a4af0 100644 --- a/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp +++ b/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp @@ -36,8 +36,9 @@ #include #include #include +#include -#if !defined(QT_OPENGL_ES_2) && defined(QT_OPENGL_4_3) +#if !QT_CONFIG(opengles2) && defined(QT_OPENGL_4_3) #define TEST_SHOULD_BE_PERFORMED 1 @@ -255,7 +256,7 @@ private Q_SLOTS: return; } - if ((m_func = m_glContext.versionFunctions()) != nullptr) { + if ((m_func = QOpenGLVersionFunctionsFactory::get()) != nullptr) { m_glHelper.initializeHelper(&m_glContext, m_func); m_initializationSuccessful = true; } diff --git a/tests/auto/render/render.pro b/tests/auto/render/render.pro index e772e3ddd..4582b7644 100644 --- a/tests/auto/render/render.pro +++ b/tests/auto/render/render.pro @@ -143,9 +143,7 @@ qtConfig(qt3d-opengl-renderer):qtConfig(private_tests) { qmaterial \ geometryloaders \ picking \ - pickboundingvolumejob \ - gltfplugins \ - updateshaderdatatransformjob + gltfplugins } qtConfig(qt3d-input) { diff --git a/tests/auto/render/shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp b/tests/auto/render/shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp index 27cf7f425..efce243bd 100644 --- a/tests/auto/render/shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp +++ b/tests/auto/render/shadergraph/qshadernodesloader/tst_qshadernodesloader.cpp @@ -32,6 +32,7 @@ #include #include +#include #include using namespace Qt3DRender; @@ -86,11 +87,21 @@ class tst_QShaderNodesLoader : public QObject { Q_OBJECT private slots: + void initTestCase(); void shouldManipulateLoaderMembers(); void shouldLoadFromJsonStream_data(); void shouldLoadFromJsonStream(); }; +void tst_QShaderNodesLoader::initTestCase() +{ + // Make sure we register the meta types. This is done by the + // QShaderGraphLoader ctor usually but in this test, no QShaderGraphLoader + // is used so we need to to it ourselves + QShaderGraphLoader l; + Q_UNUSED(l); +} + void tst_QShaderNodesLoader::shouldManipulateLoaderMembers() { // GIVEN diff --git a/tests/manual/boundingvolumes/main.cpp b/tests/manual/boundingvolumes/main.cpp index 2a988a271..4d22a5b68 100644 --- a/tests/manual/boundingvolumes/main.cpp +++ b/tests/manual/boundingvolumes/main.cpp @@ -56,7 +56,7 @@ int main(int argc, char **argv) { // Set OpenGL requirements QSurfaceFormat format = QSurfaceFormat::defaultFormat(); -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) format.setVersion(4, 1); format.setProfile(QSurfaceFormat::CoreProfile); format.setSamples(4); diff --git a/tests/manual/manual-renderloop/main.cpp b/tests/manual/manual-renderloop/main.cpp index 44d661136..a3f108e50 100644 --- a/tests/manual/manual-renderloop/main.cpp +++ b/tests/manual/manual-renderloop/main.cpp @@ -172,7 +172,7 @@ private: int main(int ac, char **av) { QSurfaceFormat format = QSurfaceFormat::defaultFormat(); -#ifdef QT_OPENGL_ES_2 +#if QT_CONFIG(opengles2) format.setRenderableType(QSurfaceFormat::OpenGLES); #else if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { diff --git a/tests/manual/qtbug-76766/main.cpp b/tests/manual/qtbug-76766/main.cpp index f9d49846a..d6cfabd89 100644 --- a/tests/manual/qtbug-76766/main.cpp +++ b/tests/manual/qtbug-76766/main.cpp @@ -44,7 +44,7 @@ void setSurfaceFormat() { QSurfaceFormat format; -#ifdef QT_OPENGL_ES_2 +#if QT_CONFIG(opengles2) format.setRenderableType(QSurfaceFormat::OpenGLES); #else if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { diff --git a/tests/manual/rendercapture-cpp/orbittransformcontroller.h b/tests/manual/rendercapture-cpp/orbittransformcontroller.h index 5f41722b6..98143388c 100644 --- a/tests/manual/rendercapture-cpp/orbittransformcontroller.h +++ b/tests/manual/rendercapture-cpp/orbittransformcontroller.h @@ -54,13 +54,10 @@ #include #include +#include QT_BEGIN_NAMESPACE -namespace Qt3DCore { -class QTransform; -} - class OrbitTransformController : public QObject { Q_OBJECT -- cgit v1.2.3