diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2022-12-19 12:23:17 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2023-02-10 12:37:17 +0100 |
commit | c889af388062bbee6e52e68a22ac8632fb12ff02 (patch) | |
tree | 0b4823adb8ca383e0a55fcbeb6e262363c42e0e8 | |
parent | 390f724912eb73461295e68535e053eb27e28af9 (diff) |
Remove Qt6 QT_VERSION checks from the code base
Those are left overs from the Qt 5.15 to Qt 6 port. Now that both
code based have diverged, there's no much point in keeping those
checks.
Pick-to: 6.5
Change-Id: I4e83876b6b4cb18b181af32e376f4411054a1183
Reviewed-by: Mike Krus <mike.krus@kdab.com>
81 files changed, 1 insertions, 658 deletions
diff --git a/examples/qt3d/3d-text/main.cpp b/examples/qt3d/3d-text/main.cpp index 4967958aa..9aa44ba60 100644 --- a/examples/qt3d/3d-text/main.cpp +++ b/examples/qt3d/3d-text/main.cpp @@ -34,11 +34,7 @@ int main(int argc, char *argv[]) auto *textMaterial = new Qt3DExtras::QPhongMaterial(root); { // text int i = 0; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const QStringList fonts = QFontDatabase::families(); -#else - const QStringList fonts = QFontDatabase().families(); -#endif for (const QString &family : fonts) { diff --git a/src/core/qt3dcore_global.h b/src/core/qt3dcore_global.h index be7f29f94..dbde1f127 100644 --- a/src/core/qt3dcore_global.h +++ b/src/core/qt3dcore_global.h @@ -51,13 +51,8 @@ QT_BEGIN_NAMESPACE QT3D_DECLARE_TYPEINFO_2(OuterNS, InnerNS, Class, Q_RELOCATABLE_TYPE) \ /*end*/ -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#define QT3D_REVISION(major, minor) Q_REVISION(minor) -#define QT3D_PROPERTY_REVISION(major, minor) REVISION minor -#else #define QT3D_REVISION(major, minor) Q_REVISION(major, minor) #define QT3D_PROPERTY_REVISION(major, minor) REVISION(major, minor) -#endif QT_END_NAMESPACE diff --git a/src/core/resources/qresourcemanager_p.h b/src/core/resources/qresourcemanager_p.h index 741cd7403..38e5a4fb5 100644 --- a/src/core/resources/qresourcemanager_p.h +++ b/src/core/resources/qresourcemanager_p.h @@ -129,11 +129,7 @@ public : } private: -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QMutexLocker<QMutex> m_locker; -#else - QMutexLocker m_locker; -#endif }; private: diff --git a/src/extras/defaults/qt3dwindow.cpp b/src/extras/defaults/qt3dwindow.cpp index 19186978e..aa9661390 100644 --- a/src/extras/defaults/qt3dwindow.cpp +++ b/src/extras/defaults/qt3dwindow.cpp @@ -222,11 +222,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept } else if (userRequestedApi == QByteArrayLiteral("null")) { api = Qt3DRender::API::Null; } else if (userRequestedApi == QByteArrayLiteral("auto")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) api = Qt3DRender::API::RHI; -#else - api = Qt3DRender::API::OpenGL; -#endif } } @@ -235,7 +231,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept // backend is in use will get a valid value. bool useRhi = false; if (qEnvironmentVariableIsEmpty("QT3D_RENDERER")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && QT_CONFIG(qt3d_rhi_renderer) +#if QT_CONFIG(qt3d_rhi_renderer) qputenv("QT3D_RENDERER", "rhi"); #else qputenv("QT3D_RENDERER", "opengl"); diff --git a/src/input/backend/inputhandler.cpp b/src/input/backend/inputhandler.cpp index f3c407f4a..7732ad98f 100644 --- a/src/input/backend/inputhandler.cpp +++ b/src/input/backend/inputhandler.cpp @@ -42,12 +42,8 @@ protected: case QEvent::HoverMove: { const QHoverEvent *he = static_cast<QHoverEvent *>(e); auto mouseEvent = QT_PREPEND_NAMESPACE(QMouseEvent)(QEvent::MouseMove, -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) he->position(), he->globalPosition(), -#else - he->pos(), -#endif Qt::NoButton, Qt::NoButton, he->modifiers()); return processMouseEvent(obj, static_cast<QT_PREPEND_NAMESPACE(QMouseEvent) *>(&mouseEvent)); diff --git a/src/input/backend/mousedevice.cpp b/src/input/backend/mousedevice.cpp index 7814edb28..7f841d652 100644 --- a/src/input/backend/mousedevice.cpp +++ b/src/input/backend/mousedevice.cpp @@ -111,20 +111,11 @@ void MouseDevice::updateMouseEvent(QT_PREPEND_NAMESPACE(QMouseEvent) *event) m_mouseState.rightPressed = event->buttons() & (Qt::RightButton); const bool pressed = m_mouseState.leftPressed || m_mouseState.centerPressed || m_mouseState.rightPressed; if (m_updateAxesContinuously || (m_wasPressed && pressed)) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) m_mouseState.xAxis += m_sensitivity * float(event->globalPosition().x() - m_previousPos.x()); m_mouseState.yAxis += m_sensitivity * float(m_previousPos.y() - event->globalPosition().y()); -#else - m_mouseState.xAxis += m_sensitivity * float(event->globalX() - m_previousPos.x()); - m_mouseState.yAxis += m_sensitivity * float(m_previousPos.y() - event->globalY()); -#endif } m_wasPressed = pressed; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) m_previousPos = event->globalPosition(); -#else - m_previousPos = event->globalPos(); -#endif } void MouseDevice::resetMouseAxisState() diff --git a/src/input/frontend/qkeyboardhandler.h b/src/input/frontend/qkeyboardhandler.h index 2f8c41cf5..3939798f3 100644 --- a/src/input/frontend/qkeyboardhandler.h +++ b/src/input/frontend/qkeyboardhandler.h @@ -20,9 +20,7 @@ class Q_3DINPUTSHARED_EXPORT QKeyboardHandler : public Qt3DCore::QComponent Q_OBJECT Q_PROPERTY(Qt3DInput::QKeyboardDevice *sourceDevice READ sourceDevice WRITE setSourceDevice NOTIFY sourceDeviceChanged) Q_PROPERTY(bool focus READ focus WRITE setFocus NOTIFY focusChanged) -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) Q_MOC_INCLUDE("Qt3DInput/qkeyboarddevice.h") -#endif public: explicit QKeyboardHandler(QNode *parent = nullptr); ~QKeyboardHandler(); diff --git a/src/input/frontend/qkeyevent.cpp b/src/input/frontend/qkeyevent.cpp index 2a2d066fe..de688c0a4 100644 --- a/src/input/frontend/qkeyevent.cpp +++ b/src/input/frontend/qkeyevent.cpp @@ -45,11 +45,7 @@ QKeyEvent::QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers QKeyEvent::QKeyEvent(const QT_PREPEND_NAMESPACE(QKeyEvent) &ke) : QObject() -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) , m_event(static_cast<QT_PREPEND_NAMESPACE(QKeyEvent) *>(ke.clone())) -#else - , m_event(new QT_PREPEND_NAMESPACE(QKeyEvent)(ke)) -#endif { m_event->setAccepted(false); } diff --git a/src/input/frontend/qmouseevent.cpp b/src/input/frontend/qmouseevent.cpp index cc4645356..79182281b 100644 --- a/src/input/frontend/qmouseevent.cpp +++ b/src/input/frontend/qmouseevent.cpp @@ -223,11 +223,7 @@ typename EventClass::Modifiers modifiersForEvent(const QtEventClass *event) */ QMouseEvent::QMouseEvent(const QT_PREPEND_NAMESPACE(QMouseEvent) &e) : QObject() -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) , m_event(static_cast<QT_PREPEND_NAMESPACE(QMouseEvent)*>(e.clone())) -#else - , m_event(new QT_PREPEND_NAMESPACE(QMouseEvent)(e)) -#endif { } @@ -446,11 +442,7 @@ QMouseEvent::Modifiers QMouseEvent::modifiers() const */ QWheelEvent::QWheelEvent(const QT_PREPEND_NAMESPACE(QWheelEvent) &e) : QObject() -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) , m_event(static_cast<QT_PREPEND_NAMESPACE(QWheelEvent)*>(e.clone())) -#else - , m_event(new QT_PREPEND_NAMESPACE(QWheelEvent)(e)) -#endif { } diff --git a/src/input/frontend/qmouseevent.h b/src/input/frontend/qmouseevent.h index 136203619..81c164648 100644 --- a/src/input/frontend/qmouseevent.h +++ b/src/input/frontend/qmouseevent.h @@ -49,13 +49,8 @@ public: explicit QMouseEvent(const QT_PREPEND_NAMESPACE(QMouseEvent) &e); ~QMouseEvent(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) inline int x() const { return int(m_event->position().x()); } inline int y() const { return int(m_event->position().y()); } -#else - inline int x() const { return int(m_event->x()); } - inline int y() const { return int(m_event->y()); } -#endif inline bool wasHeld() const { #if QT_CONFIG(gestures) return static_cast<Qt::GestureType>(m_event->type()) == Qt::TapAndHoldGesture; diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp index 6bcb3deb1..478fc8f2e 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp @@ -28,9 +28,7 @@ #include <glshader_p.h> #if !QT_CONFIG(opengles2) -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QtOpenGL/QOpenGLVersionFunctionsFactory> -#endif #include <QOpenGLFunctions_2_0> #include <QOpenGLFunctions_3_2_Core> #include <QOpenGLFunctions_3_3_Core> @@ -48,13 +46,9 @@ #include <QSurface> #include <QWindow> #include <QOpenGLTexture> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #ifdef QT_OPENGL_LIB #include <QtOpenGL/QOpenGLDebugLogger> #endif -#else -#include <QOpenGLDebugLogger> -#endif QT_BEGIN_NAMESPACE @@ -358,32 +352,16 @@ GraphicsHelperInterface *GraphicsContext::resolveHighestOpenGLFunctions() #if !QT_CONFIG(opengles2) else { QAbstractOpenGLFunctions *glFunctions = nullptr; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_3_Core>()) != nullptr) { -#else - if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_4_3_Core>()) != nullptr) { -#endif qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 4.3"; glHelper = new GraphicsHelperGL4(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) } else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_3_Core>()) != nullptr) { -#else - } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_3_3_Core>()) != nullptr) { -#endif qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 3.3"; glHelper = new GraphicsHelperGL3_3(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) } else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_2_Core>()) != nullptr) { -#else - } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_3_2_Core>()) != nullptr) { -#endif qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 3.2"; glHelper = new GraphicsHelperGL3_2(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) } else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_2_0>()) != nullptr) { -#else - } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_2_0>()) != nullptr) { -#endif qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 2 Helper"; glHelper = new GraphicsHelperGL2(); } diff --git a/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h b/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h index 37d999eec..d10e9fa0e 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h +++ b/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h @@ -60,12 +60,7 @@ public: static QVarLengthArray<char, 64> array(16 * byteSize); memset(array.data(), 0, array.size()); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) switch (v.metaType().id()) { -#else - switch (v.type()) { -#endif - // 1 byte case QMetaType::Bool: { T data = v.value<bool>(); @@ -300,11 +295,7 @@ public: } } else -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) qWarning() << Q_FUNC_INFO << "QVariant type conversion not handled for " << v.metaType().id(); -#else - qWarning() << Q_FUNC_INFO << "QVariant type conversion not handled for " << v.type(); -#endif break; } diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp index e2cee1fcd..ca6e0ce49 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -47,13 +47,9 @@ #include <QSurface> #include <QWindow> #include <QOpenGLTexture> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #ifdef QT_OPENGL_LIB #include <QtOpenGL/QOpenGLDebugLogger> #endif -#else -#include <QOpenGLDebugLogger> -#endif QT_BEGIN_NAMESPACE diff --git a/src/plugins/renderers/opengl/textures/gltexture.cpp b/src/plugins/renderers/opengl/textures/gltexture.cpp index f6bd38fc3..7d63fa552 100644 --- a/src/plugins/renderers/opengl/textures/gltexture.cpp +++ b/src/plugins/renderers/opengl/textures/gltexture.cpp @@ -9,9 +9,7 @@ #include <private/qopengltexturehelper_p.h> #include <QDebug> #include <QOpenGLFunctions> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QtOpenGL/QOpenGLVersionFunctionsFactory> -#endif #include <QOpenGLTexture> #include <QOpenGLPixelTransferOptions> #include <Qt3DRender/qtexture.h> @@ -656,11 +654,7 @@ void GLTexture::introspectPropertiesFromSharedTextureId() if (ctxGLVersion.first > 4 || (ctxGLVersion.first == 4 && ctxGLVersion.second >= 5)) { // Only for GL 4.5+ #ifdef GL_TEXTURE_TARGET -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QOpenGLFunctions_4_5_Core *gl5 = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_5_Core>(); -#else - QOpenGLFunctions_4_5_Core *gl5 = ctx->versionFunctions<QOpenGLFunctions_4_5_Core>(); -#endif if (gl5 != nullptr) gl5->glGetTextureParameteriv(m_sharedTextureId, GL_TEXTURE_TARGET, reinterpret_cast<int *>(&m_properties.target)); #endif @@ -732,11 +726,7 @@ void GLTexture::introspectPropertiesFromSharedTextureId() #if !QT_CONFIG(opengles2) // Try to retrieve dimensions (not available on ES 2.0) if (!ctx->isOpenGLES()) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QOpenGLFunctions_3_1 *gl3 = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_1>(); -#else - QOpenGLFunctions_3_1 *gl3 = ctx->versionFunctions<QOpenGLFunctions_3_1>(); -#endif if (!gl3) { qWarning() << "Failed to retrieve shared texture dimensions"; return; diff --git a/src/plugins/sceneparsers/assimp/assimpimporter.cpp b/src/plugins/sceneparsers/assimp/assimpimporter.cpp index 91763d156..f080ebd23 100644 --- a/src/plugins/sceneparsers/assimp/assimpimporter.cpp +++ b/src/plugins/sceneparsers/assimp/assimpimporter.cpp @@ -810,11 +810,7 @@ QGeometryRenderer *AssimpImporter::loadMesh(uint meshIndex) = new Qt3DAnimation::QMorphingAnimation(geometryRenderer); QList<QString> names; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QList<Qt3DAnimation::QMorphTarget *> targets; -#else - QVector<Qt3DAnimation::QMorphTarget *> targets; -#endif uint voff = 0; uint noff = 0; uint tanoff = 0; @@ -1131,11 +1127,7 @@ void AssimpImporter::loadAnimation(uint animationIndex) aiMesh *mesh = m_scene->m_aiScene->mMeshes[targetNode->mMeshes[0]]; Qt3DAnimation::QMorphingAnimation *morphingAnimation = new Qt3DAnimation::QMorphingAnimation; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QList<float> positions; -#else - QVector<float> positions; -#endif positions.resize(morphAnim->mNumKeys); // set so that weights array is allocated to correct size in morphingAnimation morphingAnimation->setTargetPositions(positions); @@ -1143,11 +1135,7 @@ void AssimpImporter::loadAnimation(uint animationIndex) aiMeshMorphKey &key = morphAnim->mKeys[j]; positions[j] = key.mTime * tickScale; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QList<float> weights; -#else - QVector<float> weights; -#endif weights.resize(key.mNumValuesAndWeights); for (int k = 0; k < weights.size(); k++) { const unsigned int value = key.mValues[k]; diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.cpp b/src/plugins/sceneparsers/gltf/gltfimporter.cpp index 69d4c8954..93896afdc 100644 --- a/src/plugins/sceneparsers/gltf/gltfimporter.cpp +++ b/src/plugins/sceneparsers/gltf/gltfimporter.cpp @@ -1819,11 +1819,7 @@ void GLTFImporter::processJSONMesh(const QString &id, const QJsonObject &json) target->setProperty(propName.constData(), QVariant(size)); } } else { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const QMetaType propType = target->property(propName.constData()).metaType(); -#else - const QMetaType propType(target->property(propName.constData()).type()); -#endif if (propType.id() == QMetaType::Int) { target->setProperty(propName.constData(), QVariant(it.value().toInt())); } else { diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp index 31808caa7..e0a60fd4a 100644 --- a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp +++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp @@ -627,11 +627,7 @@ void GLTFExporter::parseMaterials() if (material->effect()) { QList<QParameter *> parameters = material->effect()->parameters(); for (auto param : parameters) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if (param->value().metaType().id() == QMetaType::QColor) { -#else - if (param->value().type() == QMetaType::QColor) { -#endif QColor color = param->value().value<QColor>(); if (param->name() == MATERIAL_AMBIENT_COLOR) { matInfo.colors.insert(QStringLiteral("ambient"), color); @@ -1768,11 +1764,7 @@ void GLTFExporter::exportParameter(QJsonObject &jsonObj, const QString &name, paramObj[typeStr] = GL_SAMPLER_2D; paramObj[valueStr] = m_textureIdMap.value(textureVariantToUrl(variant)); } else { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) switch (variant.metaType().id()) { -#else - switch (variant.type()) { -#endif case QMetaType::Bool: paramObj[typeStr] = GL_BOOL; paramObj[valueStr] = variant.toBool(); @@ -2044,11 +2036,7 @@ QString GLTFExporter::textureVariantToUrl(const QVariant &var) void GLTFExporter::setVarToJSonObject(QJsonObject &jsObj, const QString &key, const QVariant &var) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) switch (var.metaType().id()) { -#else - switch (var.type()) { -#endif case QMetaType::Bool: jsObj[key] = var.toBool(); break; diff --git a/src/quick3d/imports/scene3d/scene3drenderer.cpp b/src/quick3d/imports/scene3d/scene3drenderer.cpp index 49f15d6ca..d9b292cc2 100644 --- a/src/quick3d/imports/scene3d/scene3drenderer.cpp +++ b/src/quick3d/imports/scene3d/scene3drenderer.cpp @@ -9,9 +9,7 @@ #include <qopenglcontext.h> #include <qopenglframebufferobject.h> #include <QtQuick/qquickwindow.h> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <private/qrhi_p.h> -#endif #include <Qt3DRender/private/qrenderaspect_p.h> #include <Qt3DRender/private/abstractrenderer_p.h> @@ -127,12 +125,10 @@ void Scene3DRenderer::init(Qt3DCore::QAspectEngine *aspectEngine, Qt3DRender::QRenderAspectPrivate *aspectPriv = static_cast<QRenderAspectPrivate*>(QRenderAspectPrivate::get(m_renderAspect)); Qt3DRender::Render::AbstractRenderer *renderer = aspectPriv->m_renderer; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const bool isRHI = renderer->api() == API::RHI; if (isRHI) m_quickRenderer = new Scene3DRenderer::RHIRenderer; else -#endif m_quickRenderer = new Scene3DRenderer::GLRenderer; m_quickRenderer->initialize(this, renderer); } @@ -146,15 +142,10 @@ void Scene3DRenderer::setWindow(QQuickWindow *window) m_window = window; if (m_window) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QObject::connect(m_window, &QQuickWindow::beforeRendering, this, [this] () { m_quickRenderer->beforeRendering(this); }, Qt::DirectConnection); QObject::connect(m_window, &QQuickWindow::beforeRenderPassRecording, this, [this] () { m_quickRenderer->beforeRenderPassRecording(this); }, Qt::DirectConnection); -#else - QObject::connect(m_window, &QQuickWindow::beforeRendering, this, - [this] () { m_quickRenderer->beforeRenderPassRecording(this); }, Qt::DirectConnection); -#endif } else { shutdown(); } @@ -311,12 +302,7 @@ void Scene3DRenderer::GLRenderer::beforeSynchronize(Scene3DRenderer *scene3DRend if (generateNewTexture) { m_finalFBO.reset(createFramebufferObject(m_lastSize)); m_textureId = m_finalFBO->texture(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) m_texture.reset(QNativeInterface::QSGOpenGLTexture::fromNative(m_textureId, window, m_finalFBO->size(), QQuickWindow::TextureHasAlphaChannel)); -#else - m_texture.reset(window->createTextureFromNativeObject(QQuickWindow::NativeObjectTexture, &m_textureId, - 0, m_finalFBO->size(), QQuickWindow::TextureHasAlphaChannel)); -#endif } // Set texture on node @@ -349,12 +335,6 @@ void Scene3DRenderer::GLRenderer::beforeRenderPassRecording(Scene3DRenderer *sce scene3DRenderer->m_shouldRender = false; ContextSaver saver; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - // The OpenGL state may be dirty from the previous QtQuick nodes, so reset - // it here to give Qt3D the clean state it expects - scene3DRenderer->m_window->resetOpenGLState(); -#endif - // Create and bind FBO if using the FBO compositing mode const bool usesFBO = scene3DRenderer->m_compositingMode == Scene3DItem::FBO; if (usesFBO) { @@ -395,12 +375,6 @@ void Scene3DRenderer::GLRenderer::beforeRenderPassRecording(Scene3DRenderer *sce if (scene3DRenderer->m_node) scene3DRenderer->m_node->show(); } - -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - // Reset the state used by the QtQuick scenegraph to avoid any - // interference when rendering the rest of the UI - scene3DRenderer->m_window->resetOpenGLState(); -#endif } void Scene3DRenderer::GLRenderer::shutdown(Scene3DRenderer *sceneRenderer) @@ -414,8 +388,6 @@ void Scene3DRenderer::GLRenderer::shutdown(Scene3DRenderer *sceneRenderer) m_multisampledFBO.reset(); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - void Scene3DRenderer::RHIRenderer::initialize(Scene3DRenderer *scene3DRenderer, Qt3DRender::Render::AbstractRenderer *renderer) { @@ -619,8 +591,6 @@ void Scene3DRenderer::RHIRenderer::releaseRHIResources() m_rhiRenderTargetPassDescriptor = nullptr; } -#endif - Scene3DRenderer::QuickRenderer::QuickRenderer() {} Scene3DRenderer::QuickRenderer::~QuickRenderer() {} diff --git a/src/quick3d/imports/scene3d/scene3drenderer_p.h b/src/quick3d/imports/scene3d/scene3drenderer_p.h index c6f5b7c31..f131c7525 100644 --- a/src/quick3d/imports/scene3d/scene3drenderer_p.h +++ b/src/quick3d/imports/scene3d/scene3drenderer_p.h @@ -123,7 +123,6 @@ private: quint32 m_textureId = 0; }; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class RHIRenderer : public QuickRenderer { public: @@ -146,7 +145,6 @@ private: QRhiRenderPassDescriptor *m_rhiRenderTargetPassDescriptor = nullptr; QRhi *m_rhi = nullptr; }; -#endif Qt3DCore::QAspectEngine *m_aspectEngine; // Will be released by the Scene3DItem QRenderAspect *m_renderAspect; // Will be released by the aspectEngine diff --git a/src/quick3d/imports/scene3d/scene3dsgmaterial.cpp b/src/quick3d/imports/scene3d/scene3dsgmaterial.cpp index 02f306a99..0d1ea7384 100644 --- a/src/quick3d/imports/scene3d/scene3dsgmaterial.cpp +++ b/src/quick3d/imports/scene3d/scene3dsgmaterial.cpp @@ -28,15 +28,9 @@ Scene3DSGMaterial::Scene3DSGMaterial() { } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QSGMaterialShader *Scene3DSGMaterial::createShader(QSGRendererInterface::RenderMode renderMode) const -#else -QSGMaterialShader *Scene3DSGMaterial::createShader() const -#endif { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) Q_UNUSED(renderMode); -#endif return new Scene3DSGMaterialShader(); } diff --git a/src/quick3d/imports/scene3d/scene3dsgmaterial_p.h b/src/quick3d/imports/scene3d/scene3dsgmaterial_p.h index 605bba9b3..b84f55f26 100644 --- a/src/quick3d/imports/scene3d/scene3dsgmaterial_p.h +++ b/src/quick3d/imports/scene3d/scene3dsgmaterial_p.h @@ -37,11 +37,7 @@ public: QSGTexture *texture() const noexcept { return m_texture; } QSGMaterialType *type() const final { return &Scene3DSGMaterialShader::type; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QSGMaterialShader *createShader(QSGRendererInterface::RenderMode renderMode) const final; -#else - QSGMaterialShader *createShader() const final; -#endif void show() { m_visible = true; } bool visible() const { return m_visible; } diff --git a/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp b/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp index 8d8ae04e7..12d396735 100644 --- a/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp +++ b/src/quick3d/imports/scene3d/scene3dsgmaterialshader.cpp @@ -42,13 +42,10 @@ Scene3DSGMaterialShader::Scene3DSGMaterialShader() // Generated with qsb, we target all GL version Qt3D can handle // qsb -b --glsl "460,450,440,430,420,410,400,330,150,120,320 es,300 es,100 es" --hlsl 50 --msl 12 -o scene3dmaterial.vert.qsb scene3dmaterial.vert // qsb --glsl "460,450,440,430,420,410,400,330,150,120,320 es,300 es,100 es" --hlsl 50 --msl 12 -o scene3dmaterial.frag.qsb scene3dmaterial.frag -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) setShaderFileName(VertexStage, QLatin1String(":/shaders/scene3dmaterial.vert.qsb")); setShaderFileName(FragmentStage, QLatin1String(":/shaders/scene3dmaterial.frag.qsb")); -#endif } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool Scene3DSGMaterialShader::updateUniformData(QSGMaterialShader::RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) @@ -118,100 +115,6 @@ void Scene3DSGMaterialShader::updateSampledImage(QSGMaterialShader::RenderState } } -#else - -const char * const *Qt3DRender::Scene3DSGMaterialShader::attributeNames() const -{ - static char const *const attr[] = { "qt_VertexPosition", "qt_VertexTexCoord", nullptr }; - return attr; -} - -const char *Scene3DSGMaterialShader::vertexShader() const -{ - QOpenGLContext *ctx = QOpenGLContext::currentContext(); - if (ctx->format().version() >= qMakePair(3, 2) && ctx->format().profile() == QSurfaceFormat::CoreProfile) { - return "" - "#version 150 core \n" - "uniform mat4 qt_Matrix; \n" - "in vec4 qt_VertexPosition; \n" - "in vec2 qt_VertexTexCoord; \n" - "out vec2 qt_TexCoord; \n" - "void main() { \n" - " qt_TexCoord = qt_VertexTexCoord; \n" - " gl_Position = qt_Matrix * qt_VertexPosition; \n" - "}"; - } else { - return "" - "uniform highp mat4 qt_Matrix; \n" - "attribute highp vec4 qt_VertexPosition; \n" - "attribute highp vec2 qt_VertexTexCoord; \n" - "varying highp vec2 qt_TexCoord; \n" - "void main() { \n" - " qt_TexCoord = qt_VertexTexCoord; \n" - " gl_Position = qt_Matrix * qt_VertexPosition; \n" - "}"; - } -} -const char *Scene3DSGMaterialShader::fragmentShader() const -{ - QOpenGLContext *ctx = QOpenGLContext::currentContext(); - if (ctx->format().version() >= qMakePair(3, 2) && ctx->format().profile() == QSurfaceFormat::CoreProfile) { - return "" - "#version 150 core \n" - "uniform sampler2D source; \n" - "uniform float qt_Opacity; \n" - "in vec2 qt_TexCoord; \n" - "out vec4 fragColor; \n" - "void main() { \n" - " vec4 p = texture(source, qt_TexCoord); \n" - " float a = qt_Opacity * p.a; \n" - " fragColor = vec4(p.rgb * a, a); \n" - "}"; - } else { - return "" - "uniform highp sampler2D source; \n" - "uniform highp float qt_Opacity; \n" - "varying highp vec2 qt_TexCoord; \n" - "void main() { \n" - " highp vec4 p = texture2D(source, qt_TexCoord); \n" - " highp float a = qt_Opacity * p.a; \n" - " gl_FragColor = vec4(p.rgb * a, a); \n" - "}"; - } -} -void Scene3DSGMaterialShader::initialize() -{ - m_matrixId = program()->uniformLocation("qt_Matrix"); - m_opacityId = program()->uniformLocation("qt_Opacity"); -} -void Scene3DSGMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) -{ - Q_ASSERT(oldEffect == 0 || newEffect->type() == oldEffect->type()); - Scene3DSGMaterial *tx = static_cast<Scene3DSGMaterial *>(newEffect); - Scene3DSGMaterial *oldTx = static_cast<Scene3DSGMaterial *>(oldEffect); - QSGTexture *t = tx->texture(); - bool npotSupported = const_cast<QOpenGLContext *>(state.context()) - ->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat); - if (!npotSupported) { - QSize size = t->textureSize(); - const bool isNpot = !isPowerOfTwo(size.width()) || !isPowerOfTwo(size.height()); - if (isNpot) { - t->setHorizontalWrapMode(QSGTexture::ClampToEdge); - t->setVerticalWrapMode(QSGTexture::ClampToEdge); - } - } - if (oldTx == 0 || oldTx->texture()->textureId() != t->textureId()) - t->bind(); - else - t->updateBindOptions(); - if (state.isMatrixDirty()) - program()->setUniformValue(m_matrixId, state.combinedMatrix()); - if (state.isOpacityDirty()) - program()->setUniformValue(m_opacityId, state.opacity()); -} - -#endif - } // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h b/src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h index 64984f32b..ce02a8608 100644 --- a/src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h +++ b/src/quick3d/imports/scene3d/scene3dsgmaterialshader_p.h @@ -29,23 +29,8 @@ public: protected: // QSGMaterialShader interface -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool updateUniformData(RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) final; void updateSampledImage(RenderState &state, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) final; -#else -public: - char const *const *attributeNames() const final; - void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) final; - -protected: - const char *vertexShader() const final; - const char *fragmentShader() const final; - void initialize() final; - -private: - int m_matrixId = -1; - int m_opacityId = -1; -#endif }; } // namespace Qt3DRender diff --git a/src/quick3d/quick3d/items/quick3dbuffer.cpp b/src/quick3d/quick3d/items/quick3dbuffer.cpp index bc2c6d6df..0fa8ada23 100644 --- a/src/quick3d/quick3d/items/quick3dbuffer.cpp +++ b/src/quick3d/quick3d/items/quick3dbuffer.cpp @@ -35,13 +35,8 @@ QByteArray Quick3DBuffer::convertToRawData(const QJSValue &jsValue) Q_ASSERT(m_v4engine); QV4::Scope scope(m_v4engine); QV4::Scoped<QV4::TypedArray> typedArray(scope, -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QJSValuePrivate::convertToReturnedValue(m_v4engine, jsValue)); char *dataPtr = reinterpret_cast<char *>(typedArray->arrayData()); -#else - QJSValuePrivate::convertedToValue(m_v4engine, jsValue)); - char *dataPtr = reinterpret_cast<char *>(typedArray->arrayData()->data()); -#endif if (!typedArray) return QByteArray(); diff --git a/src/quick3d/quick3d/items/quick3dentity.cpp b/src/quick3d/quick3d/items/quick3dentity.cpp index d7487b716..b1cdfb4ab 100644 --- a/src/quick3d/quick3d/items/quick3dentity.cpp +++ b/src/quick3d/quick3d/items/quick3dentity.cpp @@ -45,12 +45,7 @@ Quick3DEntity::Quick3DEntity(QObject *parent) QQmlListProperty<QComponent> Quick3DEntity::componentList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DCore::QComponent; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *comp) { if (comp == nullptr) diff --git a/src/quick3d/quick3d/items/quick3dgeometry.cpp b/src/quick3d/quick3d/items/quick3dgeometry.cpp index 0a4912df1..5a71de7a4 100644 --- a/src/quick3d/quick3d/items/quick3dgeometry.cpp +++ b/src/quick3d/quick3d/items/quick3dgeometry.cpp @@ -15,12 +15,7 @@ Quick3DGeometry::Quick3DGeometry(QObject *parent) QQmlListProperty<Qt3DCore::QAttribute> Quick3DGeometry::attributeList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DCore::QAttribute; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *attribute) { Quick3DGeometry *geometry = static_cast<Quick3DGeometry *>(list->object); diff --git a/src/quick3d/quick3d/items/quick3djoint.cpp b/src/quick3d/quick3d/items/quick3djoint.cpp index baa79dd56..ac277ee35 100644 --- a/src/quick3d/quick3d/items/quick3djoint.cpp +++ b/src/quick3d/quick3d/items/quick3djoint.cpp @@ -20,12 +20,7 @@ Quick3DJoint::Quick3DJoint(QObject *parent) */ QQmlListProperty<QJoint> Quick3DJoint::childJoints() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QJoint; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *joint) { Quick3DJoint *jointExtension = qobject_cast<Quick3DJoint *>(list->object); diff --git a/src/quick3d/quick3d/items/quick3dnode.cpp b/src/quick3d/quick3d/items/quick3dnode.cpp index 969874136..917819e26 100644 --- a/src/quick3d/quick3d/items/quick3dnode.cpp +++ b/src/quick3d/quick3d/items/quick3dnode.cpp @@ -31,12 +31,7 @@ Quick3DNode::Quick3DNode(QObject *parent) QQmlListProperty<QObject> Quick3DNode::data() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QObject; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *obj) { if (!obj) @@ -69,12 +64,7 @@ QQmlListProperty<QObject> Quick3DNode::data() QQmlListProperty<QNode> Quick3DNode::childNodes() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QNode; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *obj) { if (!obj) diff --git a/src/quick3d/quick3d/qt3dquick_global_p.h b/src/quick3d/quick3d/qt3dquick_global_p.h index b266c320d..324bf02ea 100644 --- a/src/quick3d/quick3d/qt3dquick_global_p.h +++ b/src/quick3d/quick3d/qt3dquick_global_p.h @@ -25,10 +25,6 @@ #define Q_3DQUICKSHARED_PRIVATE_EXPORT Q_3DQUICKSHARED_EXPORT -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#define QML_ADDED_IN_VERSION(major, minor) QML_ADDED_IN_MINOR_VERSION(minor) -#endif - QT_BEGIN_NAMESPACE namespace Qt3DCore { diff --git a/src/quick3d/quick3d/qt3dquicknodefactory.cpp b/src/quick3d/quick3d/qt3dquicknodefactory.cpp index 3dce09fc6..12a3f67ae 100644 --- a/src/quick3d/quick3d/qt3dquicknodefactory.cpp +++ b/src/quick3d/quick3d/qt3dquicknodefactory.cpp @@ -28,11 +28,7 @@ QNode *QuickNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), QTypeRevision::fromVersion(typeInfo.version.first, typeInfo.version.second)); -#else - typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } return typeInfo.t.isValid() ? qobject_cast<QNode *>(typeInfo.t.create()) : nullptr; diff --git a/src/quick3d/quick3d/qt3dquickvaluetypes.cpp b/src/quick3d/quick3d/qt3dquickvaluetypes.cpp index 89f47c8ae..2902c6abd 100644 --- a/src/quick3d/quick3d/qt3dquickvaluetypes.cpp +++ b/src/quick3d/quick3d/qt3dquickvaluetypes.cpp @@ -61,7 +61,6 @@ QString QQuick3DColorValueType::toString() const return v.name(v.alpha() != 255 ? QColor::HexArgb : QColor::HexRgb); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QVariant QQuick3DColorValueType::lighter(qreal factor) const { return QQml_colorProvider()->lighter(this->v, factor); @@ -81,7 +80,6 @@ QVariant QQuick3DColorValueType::tint(QVariant tintColor) const { return QQml_colorProvider()->tint(this->v, tintColor); } -#endif qreal QQuick3DColorValueType::r() const { @@ -160,66 +158,42 @@ void QQuick3DColorValueType::setA(qreal a) void QQuick3DColorValueType::setHsvHue(qreal hsvHue) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) float hue, saturation, value, alpha; -#else - qreal hue, saturation, value, alpha; -#endif v.getHsvF(&hue, &saturation, &value, &alpha); v.setHsvF(hsvHue, saturation, value, alpha); } void QQuick3DColorValueType::setHsvSaturation(qreal hsvSaturation) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) float hue, saturation, value, alpha; -#else - qreal hue, saturation, value, alpha; -#endif v.getHsvF(&hue, &saturation, &value, &alpha); v.setHsvF(hue, hsvSaturation, value, alpha); } void QQuick3DColorValueType::setHsvValue(qreal hsvValue) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) float hue, saturation, value, alpha; -#else - qreal hue, saturation, value, alpha; -#endif v.getHsvF(&hue, &saturation, &value, &alpha); v.setHsvF(hue, saturation, hsvValue, alpha); } void QQuick3DColorValueType::setHslHue(qreal hslHue) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) float hue, saturation, lightness, alpha; -#else - qreal hue, saturation, lightness, alpha; -#endif v.getHslF(&hue, &saturation, &lightness, &alpha); v.setHslF(hslHue, saturation, lightness, alpha); } void QQuick3DColorValueType::setHslSaturation(qreal hslSaturation) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) float hue, saturation, lightness, alpha; -#else - qreal hue, saturation, lightness, alpha; -#endif v.getHslF(&hue, &saturation, &lightness, &alpha); v.setHslF(hue, hslSaturation, lightness, alpha); } void QQuick3DColorValueType::setHslLightness(qreal hslLightness) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) float hue, saturation, lightness, alpha; -#else - qreal hue, saturation, lightness, alpha; -#endif v.getHslF(&hue, &saturation, &lightness, &alpha); v.setHslF(hue, saturation, hslLightness, alpha); } diff --git a/src/quick3d/quick3d/qt3dquickvaluetypes_p.h b/src/quick3d/quick3d/qt3dquickvaluetypes_p.h index 43292f26f..8bf3cd0b2 100644 --- a/src/quick3d/quick3d/qt3dquickvaluetypes_p.h +++ b/src/quick3d/quick3d/qt3dquickvaluetypes_p.h @@ -31,10 +31,6 @@ QT_BEGIN_NAMESPACE namespace Qt3DCore { namespace Quick { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#define QML_VALUE_TYPE(v) -#endif - class Q_3DQUICKSHARED_PRIVATE_EXPORT QQuick3DColorValueType { QColor v; @@ -60,12 +56,10 @@ public: Q_INVOKABLE QString toString() const; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) Q_INVOKABLE QVariant alpha(qreal value) const; Q_INVOKABLE QVariant lighter(qreal factor = 1.5) const; Q_INVOKABLE QVariant darker(qreal factor = 2.0) const; Q_INVOKABLE QVariant tint(QVariant factor) const; -#endif qreal r() const; qreal g() const; @@ -319,10 +313,6 @@ public: void setZ(qreal); }; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#undef QML_VALUE_TYPE -#endif - } // namespace Quick } // namespace Qt3DCore diff --git a/src/quick3d/quick3danimation/items/quick3danimationcontroller.cpp b/src/quick3d/quick3danimation/items/quick3danimationcontroller.cpp index cae8c4971..77b25ae4a 100644 --- a/src/quick3d/quick3danimation/items/quick3danimationcontroller.cpp +++ b/src/quick3d/quick3danimation/items/quick3danimationcontroller.cpp @@ -15,12 +15,7 @@ QQuick3DAnimationController::QQuick3DAnimationController(QObject *parent) QQmlListProperty<QAnimationGroup> QQuick3DAnimationController::animationGroups() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAnimationGroup; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *bar) { QQuick3DAnimationController *controller = qobject_cast<QQuick3DAnimationController *>(list->object); diff --git a/src/quick3d/quick3danimation/items/quick3danimationgroup.cpp b/src/quick3d/quick3danimation/items/quick3danimationgroup.cpp index 383cdada4..d2bee0d7b 100644 --- a/src/quick3d/quick3danimation/items/quick3danimationgroup.cpp +++ b/src/quick3d/quick3danimation/items/quick3danimationgroup.cpp @@ -17,12 +17,7 @@ QQuick3DAnimationGroup::QQuick3DAnimationGroup(QObject *parent) QQmlListProperty<Qt3DAnimation::QAbstractAnimation> QQuick3DAnimationGroup::animations() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DAnimation::QAbstractAnimation; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *animation) { QQuick3DAnimationGroup *animationGroup = qobject_cast<QQuick3DAnimationGroup *>(list->object); diff --git a/src/quick3d/quick3danimation/items/quick3dchannelmapper.cpp b/src/quick3d/quick3danimation/items/quick3dchannelmapper.cpp index 49dcb73da..16ea417d9 100644 --- a/src/quick3d/quick3danimation/items/quick3dchannelmapper.cpp +++ b/src/quick3d/quick3danimation/items/quick3dchannelmapper.cpp @@ -16,12 +16,7 @@ Quick3DChannelMapper::Quick3DChannelMapper(QObject *parent) QQmlListProperty<QAbstractChannelMapping> Quick3DChannelMapper::qmlMappings() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAbstractChannelMapping; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *mapping) { Quick3DChannelMapper *extension = qobject_cast<Quick3DChannelMapper *>(list->object); diff --git a/src/quick3d/quick3danimation/items/quick3dkeyframeanimation.cpp b/src/quick3d/quick3danimation/items/quick3dkeyframeanimation.cpp index 2d3542eaf..8bdeac896 100644 --- a/src/quick3d/quick3danimation/items/quick3dkeyframeanimation.cpp +++ b/src/quick3d/quick3danimation/items/quick3dkeyframeanimation.cpp @@ -15,12 +15,7 @@ QQuick3DKeyframeAnimation::QQuick3DKeyframeAnimation(QObject *parent) QQmlListProperty<Qt3DCore::QTransform> QQuick3DKeyframeAnimation::keyframes() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DCore::QTransform; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *transform) { QQuick3DKeyframeAnimation *keyframeAnimation diff --git a/src/quick3d/quick3danimation/items/quick3dmorphinganimation.cpp b/src/quick3d/quick3danimation/items/quick3dmorphinganimation.cpp index 409e210d9..b35fef14a 100644 --- a/src/quick3d/quick3danimation/items/quick3dmorphinganimation.cpp +++ b/src/quick3d/quick3danimation/items/quick3dmorphinganimation.cpp @@ -15,12 +15,7 @@ QQuick3DMorphingAnimation::QQuick3DMorphingAnimation(QObject *parent) QQmlListProperty<Qt3DAnimation::QMorphTarget> QQuick3DMorphingAnimation::morphTargets() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DAnimation::QMorphTarget; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *morphTarget) { QQuick3DMorphingAnimation *animation = qobject_cast<QQuick3DMorphingAnimation *>(list->object); diff --git a/src/quick3d/quick3danimation/items/quick3dmorphtarget.cpp b/src/quick3d/quick3danimation/items/quick3dmorphtarget.cpp index 5abc874a5..c6c779077 100644 --- a/src/quick3d/quick3danimation/items/quick3dmorphtarget.cpp +++ b/src/quick3d/quick3danimation/items/quick3dmorphtarget.cpp @@ -15,12 +15,7 @@ QQuick3DMorphTarget::QQuick3DMorphTarget(QObject *parent) QQmlListProperty<Qt3DCore::QAttribute> QQuick3DMorphTarget::attributes() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DCore::QAttribute; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *bar) { QQuick3DMorphTarget *target = qobject_cast<QQuick3DMorphTarget *>(list->object); diff --git a/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp index c9f264ea0..9eef6740d 100644 --- a/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp +++ b/src/quick3d/quick3danimation/items/quick3dvertexblendanimation.cpp @@ -15,12 +15,7 @@ QQuick3DVertexBlendAnimation::QQuick3DVertexBlendAnimation(QObject *parent) QQmlListProperty<Qt3DAnimation::QMorphTarget> QQuick3DVertexBlendAnimation::morphTargets() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DAnimation::QMorphTarget; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *morphTarget) { QQuick3DVertexBlendAnimation *animation diff --git a/src/quick3d/quick3danimation/qt3dquickanimationnodefactory.cpp b/src/quick3d/quick3danimation/qt3dquickanimationnodefactory.cpp index 706e55881..0c0d52ae1 100644 --- a/src/quick3d/quick3danimation/qt3dquickanimationnodefactory.cpp +++ b/src/quick3d/quick3danimation/qt3dquickanimationnodefactory.cpp @@ -28,11 +28,7 @@ Qt3DCore::QNode *QuickAnimationNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), QTypeRevision::fromVersion(typeInfo.version.first, typeInfo.version.second)); -#else - typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; diff --git a/src/quick3d/quick3dextras/items/quick3dspritesheet.cpp b/src/quick3d/quick3dextras/items/quick3dspritesheet.cpp index facdf9a01..1dd2a22b6 100644 --- a/src/quick3d/quick3dextras/items/quick3dspritesheet.cpp +++ b/src/quick3d/quick3dextras/items/quick3dspritesheet.cpp @@ -21,12 +21,7 @@ Quick3DSpriteSheet::~Quick3DSpriteSheet() QQmlListProperty<Qt3DExtras::QSpriteSheetItem> Quick3DSpriteSheet::sprites() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DExtras::QSpriteSheetItem; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *sprite) { Quick3DSpriteSheet *spritesheet = qobject_cast<Quick3DSpriteSheet *>(list->object); diff --git a/src/quick3d/quick3dextras/qt3dquickextrasnodefactory.cpp b/src/quick3d/quick3dextras/qt3dquickextrasnodefactory.cpp index 33b6810ea..81e0f251c 100644 --- a/src/quick3d/quick3dextras/qt3dquickextrasnodefactory.cpp +++ b/src/quick3d/quick3dextras/qt3dquickextrasnodefactory.cpp @@ -28,11 +28,7 @@ Qt3DCore::QNode *QuickExtrasNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), QTypeRevision::fromVersion(typeInfo.version.first, typeInfo.version.second)); -#else - typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; diff --git a/src/quick3d/quick3dinput/items/quick3daction.cpp b/src/quick3d/quick3dinput/items/quick3daction.cpp index bb6e89e69..9bc23e194 100644 --- a/src/quick3d/quick3dinput/items/quick3daction.cpp +++ b/src/quick3d/quick3dinput/items/quick3daction.cpp @@ -16,12 +16,7 @@ Quick3DAction::Quick3DAction(QObject *parent) QQmlListProperty<QAbstractActionInput> Quick3DAction::qmlActionInputs() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - auto appendFunction = [](QQmlListProperty<QAbstractActionInput> *list, QAbstractActionInput *input) { Quick3DAction *action = qobject_cast<Quick3DAction *>(list->object); action->parentAction()->addInput(input); diff --git a/src/quick3d/quick3dinput/items/quick3daxis.cpp b/src/quick3d/quick3dinput/items/quick3daxis.cpp index 9b830e440..48e0dc6b0 100644 --- a/src/quick3d/quick3dinput/items/quick3daxis.cpp +++ b/src/quick3d/quick3dinput/items/quick3daxis.cpp @@ -16,12 +16,7 @@ Quick3DAxis::Quick3DAxis(QObject *parent) QQmlListProperty<QAbstractAxisInput> Quick3DAxis::qmlAxisInputs() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAbstractAxisInput; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *input) { Quick3DAxis *axis = qobject_cast<Quick3DAxis *>(list->object); diff --git a/src/quick3d/quick3dinput/items/quick3dinputchord.cpp b/src/quick3d/quick3dinput/items/quick3dinputchord.cpp index 7cadb5799..7b4885c1d 100644 --- a/src/quick3d/quick3dinput/items/quick3dinputchord.cpp +++ b/src/quick3d/quick3dinput/items/quick3dinputchord.cpp @@ -16,12 +16,7 @@ Quick3DInputChord::Quick3DInputChord(QObject *parent) QQmlListProperty<QAbstractActionInput> Quick3DInputChord::qmlActionInputs() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAbstractActionInput; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *input) { Quick3DInputChord *action = qobject_cast<Quick3DInputChord *>(list->object); diff --git a/src/quick3d/quick3dinput/items/quick3dinputsequence.cpp b/src/quick3d/quick3dinput/items/quick3dinputsequence.cpp index 9e09d7eeb..05eff2f60 100644 --- a/src/quick3d/quick3dinput/items/quick3dinputsequence.cpp +++ b/src/quick3d/quick3dinput/items/quick3dinputsequence.cpp @@ -16,12 +16,7 @@ Quick3DInputSequence::Quick3DInputSequence(QObject *parent) QQmlListProperty<QAbstractActionInput> Quick3DInputSequence::qmlActionInputs() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAbstractActionInput; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *input) { Quick3DInputSequence *action = qobject_cast<Quick3DInputSequence *>(list->object); diff --git a/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp b/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp index 5097ef024..ff3c33198 100644 --- a/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp +++ b/src/quick3d/quick3dinput/items/quick3dlogicaldevice.cpp @@ -16,12 +16,7 @@ Quick3DLogicalDevice::Quick3DLogicalDevice(QObject *parent) QQmlListProperty<QAxis> Quick3DLogicalDevice::qmlAxes() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAxis; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *axes) { Quick3DLogicalDevice *device = qobject_cast<Quick3DLogicalDevice *>(list->object); @@ -47,12 +42,7 @@ QQmlListProperty<QAxis> Quick3DLogicalDevice::qmlAxes() QQmlListProperty<QAction> Quick3DLogicalDevice::qmlActions() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAction; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *action) { Quick3DLogicalDevice *device = qobject_cast<Quick3DLogicalDevice *>(list->object); diff --git a/src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp b/src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp index ef5c46042..4cf2ef839 100644 --- a/src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp +++ b/src/quick3d/quick3dinput/items/quick3dphysicaldevice.cpp @@ -16,12 +16,7 @@ Quick3DPhysicalDevice::Quick3DPhysicalDevice(QObject *parent) : QObject(parent) QQmlListProperty<QAxisSetting> Quick3DPhysicalDevice::axisSettings() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAxisSetting; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *axisSetting) { Quick3DPhysicalDevice *device = qobject_cast<Quick3DPhysicalDevice *>(list->object); diff --git a/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp b/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp index 6c19918f7..5bd79e7b0 100644 --- a/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp +++ b/src/quick3d/quick3dinput/qt3dquickinputnodefactory.cpp @@ -28,11 +28,7 @@ Qt3DCore::QNode *QuickInputNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), QTypeRevision::fromVersion(typeInfo.version.first, typeInfo.version.second)); -#else - typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; diff --git a/src/quick3d/quick3drender/items/quick3deffect.cpp b/src/quick3d/quick3drender/items/quick3deffect.cpp index a38dddb47..f94166498 100644 --- a/src/quick3d/quick3drender/items/quick3deffect.cpp +++ b/src/quick3d/quick3drender/items/quick3deffect.cpp @@ -18,12 +18,7 @@ Quick3DEffect::Quick3DEffect(QObject *parent) QQmlListProperty<QTechnique> Quick3DEffect::techniqueList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QTechnique; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *bar) { Quick3DEffect *eff = qobject_cast<Quick3DEffect*>(list->object); @@ -59,12 +54,7 @@ QQmlListProperty<QTechnique> Quick3DEffect::techniqueList() QQmlListProperty<QParameter> Quick3DEffect::parameterList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QParameter; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *param) { Quick3DEffect *effect = qobject_cast<Quick3DEffect *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp b/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp index 2ad597294..1768604d8 100644 --- a/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp +++ b/src/quick3d/quick3drender/items/quick3dlayerfilter.cpp @@ -20,12 +20,7 @@ Quick3DLayerFilter::Quick3DLayerFilter(QObject *parent) QQmlListProperty<QLayer> Quick3DLayerFilter::qmlLayers() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QLayer; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *layer) { Quick3DLayerFilter *filter = qobject_cast<Quick3DLayerFilter *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3dmaterial.cpp b/src/quick3d/quick3drender/items/quick3dmaterial.cpp index 9f8fed800..05f55844a 100644 --- a/src/quick3d/quick3drender/items/quick3dmaterial.cpp +++ b/src/quick3d/quick3drender/items/quick3dmaterial.cpp @@ -20,12 +20,7 @@ Quick3DMaterial::Quick3DMaterial(QObject *parent) QQmlListProperty<QParameter> Quick3DMaterial::qmlParameters() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QParameter; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *param) { Quick3DMaterial *mat = qobject_cast<Quick3DMaterial *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3draycaster.cpp b/src/quick3d/quick3drender/items/quick3draycaster.cpp index ad924e8d9..4a1c570a4 100644 --- a/src/quick3d/quick3drender/items/quick3draycaster.cpp +++ b/src/quick3d/quick3drender/items/quick3draycaster.cpp @@ -20,12 +20,7 @@ Quick3DRayCaster::Quick3DRayCaster(QObject *parent) QQmlListProperty<Qt3DRender::QLayer> Qt3DRender::Render::Quick::Quick3DRayCaster::qmlLayers() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DRender::QLayer; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *layer) { QAbstractRayCaster *filter = qobject_cast<QAbstractRayCaster *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3drenderpass.cpp b/src/quick3d/quick3drender/items/quick3drenderpass.cpp index 5bc50673a..c77751f80 100644 --- a/src/quick3d/quick3drender/items/quick3drenderpass.cpp +++ b/src/quick3d/quick3drender/items/quick3drenderpass.cpp @@ -17,12 +17,7 @@ Quick3DRenderPass::Quick3DRenderPass(QObject *parent) QQmlListProperty<QFilterKey> Quick3DRenderPass::filterKeyList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QFilterKey; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *filterKey) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); @@ -48,12 +43,7 @@ QQmlListProperty<QFilterKey> Quick3DRenderPass::filterKeyList() QQmlListProperty<QRenderState> Quick3DRenderPass::renderStateList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QRenderState; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *state) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); @@ -79,12 +69,7 @@ QQmlListProperty<QRenderState> Quick3DRenderPass::renderStateList() QQmlListProperty<QParameter> Quick3DRenderPass::parameterList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QParameter; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *param) { Quick3DRenderPass *rPass = qobject_cast<Quick3DRenderPass *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp b/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp index 7c6249298..ade8f6ca7 100644 --- a/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp +++ b/src/quick3d/quick3drender/items/quick3drenderpassfilter.cpp @@ -16,11 +16,7 @@ Quick3DRenderPassFilter::Quick3DRenderPassFilter(QObject *parent) QQmlListProperty<QFilterKey> Quick3DRenderPassFilter::includeList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif auto appendFunction = [](QQmlListProperty<QFilterKey> *list, QFilterKey *v) { auto self = qobject_cast<Quick3DRenderPassFilter *>(list->object); @@ -55,11 +51,7 @@ QQmlListProperty<QFilterKey> Quick3DRenderPassFilter::includeList() QQmlListProperty<QParameter> Quick3DRenderPassFilter::parameterList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif auto appendFunction = [](QQmlListProperty<QParameter> *list, QParameter *v) { auto self = qobject_cast<Quick3DRenderPassFilter *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp b/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp index 9ede43513..534e69ad6 100644 --- a/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp +++ b/src/quick3d/quick3drender/items/quick3drendertargetoutput.cpp @@ -16,12 +16,7 @@ Quick3DRenderTargetOutput::Quick3DRenderTargetOutput(QObject * parent) QQmlListProperty<QRenderTargetOutput> Quick3DRenderTargetOutput::qmlAttachments() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QRenderTargetOutput; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *output) { Quick3DRenderTargetOutput *rT = qobject_cast<Quick3DRenderTargetOutput *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3dscreenraycaster.cpp b/src/quick3d/quick3drender/items/quick3dscreenraycaster.cpp index a28884c85..153d35f42 100644 --- a/src/quick3d/quick3drender/items/quick3dscreenraycaster.cpp +++ b/src/quick3d/quick3drender/items/quick3dscreenraycaster.cpp @@ -24,12 +24,7 @@ Quick3DScreenRayCaster::Quick3DScreenRayCaster(QObject *parent) QQmlListProperty<Qt3DRender::QLayer> Qt3DRender::Render::Quick::Quick3DScreenRayCaster::qmlLayers() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DRender::QLayer; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *layer) { QAbstractRayCaster *filter = qobject_cast<QAbstractRayCaster *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp b/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp index 76f1948b4..725dd6c6d 100644 --- a/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp +++ b/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp @@ -27,12 +27,7 @@ Quick3DShaderDataArray::Quick3DShaderDataArray(QNode *parent) QQmlListProperty<QShaderData> Quick3DShaderDataArray::valuesList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QShaderData; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *bar) { Quick3DShaderDataArray *self = static_cast<Quick3DShaderDataArray *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3dstateset.cpp b/src/quick3d/quick3drender/items/quick3dstateset.cpp index 0c37c529f..020462fab 100644 --- a/src/quick3d/quick3drender/items/quick3dstateset.cpp +++ b/src/quick3d/quick3drender/items/quick3dstateset.cpp @@ -20,12 +20,7 @@ Quick3DStateSet::~Quick3DStateSet() QQmlListProperty<QRenderState> Quick3DStateSet::renderStateList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QRenderState; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *state) { Quick3DStateSet *stateSet = qobject_cast<Quick3DStateSet *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3dtechnique.cpp b/src/quick3d/quick3drender/items/quick3dtechnique.cpp index d7ebfc9fe..5d871893f 100644 --- a/src/quick3d/quick3drender/items/quick3dtechnique.cpp +++ b/src/quick3d/quick3drender/items/quick3dtechnique.cpp @@ -16,12 +16,7 @@ Quick3DTechnique::Quick3DTechnique(QObject *parent) QQmlListProperty<QRenderPass> Quick3DTechnique::renderPassList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QRenderPass; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *renderPass) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); @@ -54,12 +49,7 @@ QQmlListProperty<QRenderPass> Quick3DTechnique::renderPassList() QQmlListProperty<QParameter> Quick3DTechnique::parameterList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QParameter; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *param) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); @@ -85,12 +75,7 @@ QQmlListProperty<QParameter> Quick3DTechnique::parameterList() QQmlListProperty<QFilterKey> Quick3DTechnique::filterKeyList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QFilterKey; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *filterKey) { Quick3DTechnique *technique = qobject_cast<Quick3DTechnique *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp b/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp index 37ac4045f..da651cf59 100644 --- a/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp +++ b/src/quick3d/quick3drender/items/quick3dtechniquefilter.cpp @@ -16,12 +16,7 @@ Quick3DTechniqueFilter::Quick3DTechniqueFilter(QObject *parent) QQmlListProperty<QFilterKey> Quick3DTechniqueFilter::matchList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QFilterKey; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *criterion) { Quick3DTechniqueFilter *filter = qobject_cast<Quick3DTechniqueFilter *>(list->object); @@ -56,12 +51,7 @@ QQmlListProperty<QFilterKey> Quick3DTechniqueFilter::matchList() QQmlListProperty<QParameter> Quick3DTechniqueFilter::parameterList() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QParameter; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *param) { Quick3DTechniqueFilter *techniqueFilter = qobject_cast<Quick3DTechniqueFilter *>(list->object); diff --git a/src/quick3d/quick3drender/items/quick3dtexture.cpp b/src/quick3d/quick3drender/items/quick3dtexture.cpp index 2929ff4d4..0acd6fc2f 100644 --- a/src/quick3d/quick3drender/items/quick3dtexture.cpp +++ b/src/quick3d/quick3drender/items/quick3dtexture.cpp @@ -18,12 +18,7 @@ Quick3DTextureExtension::Quick3DTextureExtension(QObject *parent) QQmlListProperty<QAbstractTextureImage> Quick3DTextureExtension::textureImages() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = QAbstractTextureImage; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *textureImage) { Quick3DTextureExtension *self = qobject_cast<Quick3DTextureExtension *>(list->object); diff --git a/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp b/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp index 15e287caa..12acb32a1 100644 --- a/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp +++ b/src/quick3d/quick3drender/qt3dquickrendernodefactory.cpp @@ -28,11 +28,7 @@ Qt3DCore::QNode *QuickRenderNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), QTypeRevision::fromVersion(typeInfo.version.first, typeInfo.version.second)); -#else - typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; diff --git a/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d.cpp b/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d.cpp index e4b76765d..9da79b4c0 100644 --- a/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d.cpp +++ b/src/quick3d/quick3dscene2d/items/qt3dquick3dscene2d.cpp @@ -17,12 +17,7 @@ QQuick3DScene2D::QQuick3DScene2D(QObject *parent) QQmlListProperty<Qt3DCore::QEntity> QQuick3DScene2D::entities() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) using qt_size_type = qsizetype; -#else - using qt_size_type = int; -#endif - using ListContentType = Qt3DCore::QEntity; auto appendFunction = [](QQmlListProperty<ListContentType> *list, ListContentType *entity) { QQuick3DScene2D *scene2d = qobject_cast<QQuick3DScene2D *>(list->object); diff --git a/src/quick3d/quick3dscene2d/items/scene2d.cpp b/src/quick3d/quick3dscene2d/items/scene2d.cpp index e679d56af..4afe04382 100644 --- a/src/quick3d/quick3dscene2d/items/scene2d.cpp +++ b/src/quick3d/quick3dscene2d/items/scene2d.cpp @@ -10,9 +10,7 @@ #include <QtCore/qatomic.h> #include <QtGui/qevent.h> #include <QtGui/QOpenGLFunctions> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QQuickRenderTarget> -#endif #include <private/qscene2d_p.h> #include <private/scene2d_p.h> @@ -214,11 +212,7 @@ void Scene2D::initializeRender() m_context->create(); m_context->makeCurrent(m_sharedObject->m_surface); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) m_sharedObject->m_renderControl->initialize(); -#else - m_sharedObject->m_renderControl->initialize(m_context); -#endif m_context->doneCurrent(); QCoreApplication::postEvent(m_sharedObject->m_renderManager, diff --git a/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp index c2a1b3bcd..1b090663d 100644 --- a/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp +++ b/src/quick3d/quick3dscene2d/qt3dquickscene2dnodefactory.cpp @@ -40,11 +40,7 @@ Qt3DCore::QNode *QuickScene2DNodeFactory::createNode(const char *type) if (!typeInfo.resolved) { typeInfo.resolved = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), QTypeRevision::fromVersion(typeInfo.version.first, typeInfo.version.second)); -#else - typeInfo.t = QQmlMetaType::qmlType(QString::fromLatin1(typeInfo.quickName), typeInfo.version.first, typeInfo.version.second); -#endif } return typeInfo.t.isValid() ? qobject_cast<Qt3DCore::QNode *>(typeInfo.t.create()) : nullptr; diff --git a/src/render/jobs/pickboundingvolumejob.cpp b/src/render/jobs/pickboundingvolumejob.cpp index 6178bdee2..e8ec689aa 100644 --- a/src/render/jobs/pickboundingvolumejob.cpp +++ b/src/render/jobs/pickboundingvolumejob.cpp @@ -175,11 +175,7 @@ void PickBoundingVolumeJob::setRoot(Entity *root) bool PickBoundingVolumeJob::processMouseEvent(QObject* object, QMouseEvent *event) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) m_pendingMouseEvents.emplace_back(object, std::unique_ptr<QMouseEvent>(static_cast<QMouseEvent *>(event->clone()))); -#else - m_pendingMouseEvents.emplace_back(object, new QMouseEvent(*event)); -#endif return false; } @@ -383,11 +379,7 @@ void PickBoundingVolumeJob::dispatchPickEvents(const QMouseEvent *event, localIntersection = entity->worldTransform()->inverted().map(hit.m_intersection); QPickEventPtr pickEvent; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const auto eventPos = event->position(); -#else - const auto eventPos = event->pos(); -#endif switch (hit.m_type) { case QCollisionQueryResult::Hit::Triangle: pickEvent.reset(new QPickTriangleEvent(eventPos, diff --git a/src/render/materialsystem/filterkey.cpp b/src/render/materialsystem/filterkey.cpp index 7429735ef..24fd40121 100644 --- a/src/render/materialsystem/filterkey.cpp +++ b/src/render/materialsystem/filterkey.cpp @@ -56,11 +56,7 @@ bool FilterKey::equals(const FilterKey &other) const // https://codereview.qt-project.org/#/c/204484/ // and adding the following early comparison of the types should give // an equivalent performance gain: -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) return (other.value().metaType() == value().metaType() && -#else - return (other.value().type() == value().type() && -#endif other.name() == name() && other.value() == value()); } diff --git a/src/render/materialsystem/qparameter.cpp b/src/render/materialsystem/qparameter.cpp index 990f5ee1b..b49844d96 100644 --- a/src/render/materialsystem/qparameter.cpp +++ b/src/render/materialsystem/qparameter.cpp @@ -5,10 +5,8 @@ #include "qparameter_p.h" #include <Qt3DRender/private/renderlogging_p.h> #include <Qt3DRender/qtexture.h> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QtCore/qiterable.h> #include <QtCore/qsequentialiterable.h> -#endif /*! \qmltype Parameter @@ -163,11 +161,7 @@ inline QVariant toBackendValue(const QVariant &v) void QParameterPrivate::setValue(const QVariant &v) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if (v.metaType().id() == QMetaType::QVariantList) { -#else - if (v.type() == QVariant::List) { -#endif QSequentialIterable iterable = v.value<QSequentialIterable>(); QVariantList variants; variants.reserve(iterable.size()); diff --git a/src/render/materialsystem/qshaderprogram.cpp b/src/render/materialsystem/qshaderprogram.cpp index cbb1b77b5..de1d56bb6 100644 --- a/src/render/materialsystem/qshaderprogram.cpp +++ b/src/render/materialsystem/qshaderprogram.cpp @@ -841,11 +841,7 @@ QByteArray QShaderProgramPrivate::resolveAutoBindingIndices(const QByteArray &co do { matchStart = shaderCode.indexOf(regexp, matchStart); if (matchStart != -1) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const auto match = regexp.matchView(QStringView{shaderCode}.mid(matchStart)); -#else - const auto match = regexp.match(shaderCode.mid(matchStart)); -#endif const auto length = match.capturedLength(0); shaderCode.replace(matchStart, length, replacement.arg(variable++)); } diff --git a/src/render/picking/pickeventfilter.cpp b/src/render/picking/pickeventfilter.cpp index ca06dc090..e9f29de05 100644 --- a/src/render/picking/pickeventfilter.cpp +++ b/src/render/picking/pickeventfilter.cpp @@ -36,12 +36,8 @@ bool PickEventFilter::eventFilter(QObject *obj, QEvent *e) case QEvent::HoverMove: { QHoverEvent *he = static_cast<QHoverEvent *>(e); auto mouseEvent = QMouseEvent(QEvent::MouseMove, -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) he->position(), he->globalPosition(), -#else - he->pos(), -#endif Qt::NoButton, Qt::NoButton, he->modifiers()); return m_aspect->processMouseEvent(obj, &mouseEvent); diff --git a/src/render/shadergraph/qshadergraphloader.cpp b/src/render/shadergraph/qshadergraphloader.cpp index 8194c8594..951f696c6 100644 --- a/src/render/shadergraph/qshadergraphloader.cpp +++ b/src/render/shadergraph/qshadergraphloader.cpp @@ -152,11 +152,7 @@ void QShaderGraphLoader::load() if (parameterValue.isObject()) { const QJsonObject parameterObject = parameterValue.toObject(); const QString type = parameterObject.value(QStringLiteral("type")).toString(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const QMetaType typeId = QMetaType::fromName(type.toUtf8()); -#else - const QMetaType typeId(QMetaType::type(type.toUtf8())); -#endif const QString value = parameterObject.value(QStringLiteral("value")).toString(); auto variant = QVariant(value); @@ -168,17 +164,9 @@ void QShaderGraphLoader::load() const QMetaEnum metaEnum = metaObject->enumerator(metaObject->indexOfEnumerator(enumName)); const int enumValue = metaEnum.keyToValue(value.toUtf8()); variant = QVariant(enumValue); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) variant.convert(typeId); -#else - variant.convert(typeId.id()); -#endif } else { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) variant.convert(typeId); -#else - variant.convert(typeId.id()); -#endif } node.setParameter(parameterName, variant); } else { diff --git a/src/render/shadergraph/qshadernodesloader.cpp b/src/render/shadergraph/qshadernodesloader.cpp index c0d8dc703..44563bc43 100644 --- a/src/render/shadergraph/qshadernodesloader.cpp +++ b/src/render/shadergraph/qshadernodesloader.cpp @@ -126,11 +126,7 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject) if (parameterValue.isObject()) { const QJsonObject parameterObject = parameterValue.toObject(); const QString type = parameterObject.value(QStringLiteral("type")).toString(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const QMetaType typeId = QMetaType::fromName(type.toUtf8()); -#else - const QMetaType typeId(QMetaType::type(type.toUtf8())); -#endif const QString value = parameterObject.value(QStringLiteral("value")).toString(); auto variant = QVariant(value); @@ -142,17 +138,9 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject) const QMetaEnum metaEnum = metaObject->enumerator(metaObject->indexOfEnumerator(enumName)); const int enumValue = metaEnum.keyToValue(value.toUtf8()); variant = QVariant(enumValue); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) variant.convert(typeId); -#else - variant.convert(typeId.id()); -#endif } else { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) variant.convert(typeId); -#else - variant.convert(typeId.id()); -#endif } node.setParameter(parameterName, variant); } else { diff --git a/src/render/texture/qtextureimagedata.h b/src/render/texture/qtextureimagedata.h index 3931a41e0..661958679 100644 --- a/src/render/texture/qtextureimagedata.h +++ b/src/render/texture/qtextureimagedata.h @@ -5,11 +5,7 @@ #define QT3DRENDER_TEXTUREIMAGEDATA_H #include <Qt3DRender/qt3drender_global.h> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QtOpenGL/qopengltexture.h> -#else -#include <QtGui/qopengltexture.h> -#endif #include <QtGui/QImage> #include <QtCore/QSharedPointer> diff --git a/tests/auto/render/gltfplugins/tst_gltfplugins.cpp b/tests/auto/render/gltfplugins/tst_gltfplugins.cpp index 4cb0cdb81..c03454dad 100644 --- a/tests/auto/render/gltfplugins/tst_gltfplugins.cpp +++ b/tests/auto/render/gltfplugins/tst_gltfplugins.cpp @@ -753,11 +753,7 @@ void tst_gltfPlugins::compareComponents(Qt3DCore::QComponent *c1, Qt3DCore::QCom auto property = c1->metaObject()->property(i); auto v1 = c1->property(property.name()); auto v2 = c2->property(property.name()); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) const auto v1TypeId = v1.metaType().id(); -#else - const auto v1TypeId = v1.type(); -#endif if (v1TypeId == QMetaType::Bool) { QCOMPARE(v1.toBool(), v2.toBool()); } else if (v1TypeId == QMetaType::QColor) { @@ -766,11 +762,7 @@ void tst_gltfPlugins::compareComponents(Qt3DCore::QComponent *c1, Qt3DCore::QCom QCOMPARE(v1.value<QVector3D>(), v2.value<QVector3D>()); } else if (v1TypeId == QMetaType::QMatrix4x4) { QCOMPARE(v1.value<QMatrix4x4>(), v2.value<QMatrix4x4>()); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) } else if (QMetaType::canConvert(v1.metaType(), QMetaType(QMetaType::Float))) { -#else - } else if (v1.canConvert(QMetaType::Float)) { -#endif QVERIFY(qFuzzyCompare(v1.toFloat(), v2.toFloat())); } } @@ -852,11 +844,7 @@ void tst_gltfPlugins::compareParameters(const QList<Qt3DRender::QParameter *> &p for (auto p2 : params2) { if (p1->name() == p2->name()) { pMatch = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if (p1->value().metaType().id() == QMetaType::QColor) { -#else - if (p1->value().type() == QMetaType::QColor) { -#endif // Colors are imported as QVector4Ds QColor color = p1->value().value<QColor>(); QVector4D vec = p2->value().value<QVector4D>(); diff --git a/tests/auto/render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp b/tests/auto/render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp index 3c60f6e89..723a33d41 100644 --- a/tests/auto/render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp +++ b/tests/auto/render/opengl/graphicshelpergl2/tst_graphicshelpergl2.cpp @@ -7,9 +7,7 @@ #include <graphicshelpergl2_p.h> #include <Qt3DRender/private/attachmentpack_p.h> #include <QOpenGLContext> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QOpenGLVersionFunctionsFactory> -#endif #include <QOpenGLBuffer> #include <QOpenGLFunctions_2_0> #include <QOpenGLExtraFunctions> @@ -131,11 +129,7 @@ private Q_SLOTS: return; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if ((m_func = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_2_0>()) != nullptr) { -#else - if ((m_func = m_glContext.versionFunctions<QOpenGLFunctions_2_0>())) { -#endif m_extraFunctions = m_glContext.extraFunctions(); m_glHelper.initializeHelper(&m_glContext, m_func); m_initializationSuccessful = true; 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 70330a223..ed35775da 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp @@ -7,9 +7,7 @@ #include <graphicshelpergl3_2_p.h> #include <Qt3DRender/private/attachmentpack_p.h> #include <QOpenGLBuffer> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QOpenGLVersionFunctionsFactory> -#endif #include <QOpenGLFunctions_3_2_Core> #include <QOpenGLShaderProgram> #include <QOpenGLVertexArrayObject> @@ -185,11 +183,7 @@ private Q_SLOTS: return; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if ((m_func = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_2_Core>()) != nullptr) { -#else - if ((m_func = m_glContext.versionFunctions<QOpenGLFunctions_3_2_Core>())) { -#endif m_glHelper.initializeHelper(&m_glContext, m_func); m_initializationSuccessful = true; } 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 18d3aa803..ab5683ccf 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp @@ -7,9 +7,7 @@ #include <Qt3DRender/private/attachmentpack_p.h> #include <graphicshelpergl3_3_p.h> #include <QOpenGLBuffer> -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QOpenGLVersionFunctionsFactory> -#endif #include <QOpenGLFunctions_3_3_Core> #include <QOpenGLShaderProgram> #include <QOpenGLVertexArrayObject> @@ -185,11 +183,7 @@ private Q_SLOTS: return; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if ((m_func = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_3_Core>()) != nullptr) { -#else - if ((m_func = m_glContext.versionFunctions<QOpenGLFunctions_3_3_Core>())) { -#endif 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 cb7bcbaa8..780369f48 100644 --- a/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp +++ b/tests/auto/render/opengl/graphicshelpergl4/tst_graphicshelpergl4.cpp @@ -11,10 +11,7 @@ #include <QOpenGLShaderProgram> #include <QOpenGLVertexArrayObject> #include <QSurfaceFormat> - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include <QtOpenGL/QOpenGLVersionFunctionsFactory> -#endif #if !QT_CONFIG(opengles2) && defined(QT_OPENGL_4_3) @@ -234,11 +231,7 @@ private Q_SLOTS: return; } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if ((m_func = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_3_Core>()) != nullptr) { -#else - if ((m_func = m_glContext.versionFunctions<QOpenGLFunctions_4_3_Core>()) != nullptr) { -#endif m_glHelper.initializeHelper(&m_glContext, m_func); m_initializationSuccessful = true; } @@ -906,11 +899,7 @@ private Q_SLOTS: QVERIFY(error == 0); // THEN -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QList<QVector4D> colors(512 * 512); -#else - QVector<QVector4D> colors(512 * 512); -#endif textures[3]->bind(); m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); diff --git a/tests/auto/render/qray3d/tst_qray3d.cpp b/tests/auto/render/qray3d/tst_qray3d.cpp index 874d4c95a..01943109a 100644 --- a/tests/auto/render/qray3d/tst_qray3d.cpp +++ b/tests/auto/render/qray3d/tst_qray3d.cpp @@ -492,11 +492,7 @@ void tst_QRay3D::properties() void tst_QRay3D::metaTypes() { int id = qMetaTypeId<Qt3DRender::RayCasting::QRay3D>(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QVERIFY(QMetaType::fromName("Qt3DRender::RayCasting::QRay3D").id() == id); -#else - QVERIFY(QMetaType::type("Qt3DRender::RayCasting::QRay3D") == id); -#endif QCOMPARE(QByteArray(QMetaType(id).name()), QByteArray("Qt3DRender::RayCasting::QRay3D")); QVERIFY(QMetaType::isRegistered(id)); } diff --git a/tests/auto/render/scene2d/tst_scene2d.cpp b/tests/auto/render/scene2d/tst_scene2d.cpp index 997b96d0d..2b86bede9 100644 --- a/tests/auto/render/scene2d/tst_scene2d.cpp +++ b/tests/auto/render/scene2d/tst_scene2d.cpp @@ -42,11 +42,7 @@ public: e->type() <= QEvent::MouseMove) { QMouseEvent *me = static_cast<QMouseEvent *>(e); m_eventTypes.push_back(e->type()); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) m_mousePoints.push_back(me->position()); -#else - m_mousePoints.push_back(me->pos()); -#endif } return QQuickWindow::event(e); } |