From b0dbd67d7b95cb4c74a502e04b68e3b3f9dc8e6b Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Sat, 14 Nov 2020 14:42:32 +0000 Subject: Fix deprecated API usage and compile warnings - QVariant::Type deprecated, use QMetaType related APIs - QNodeId not used as reference in for loops (nop but really noisy) - some unused code Change-Id: I291219207fcd1ad0bf89533b4e2bb5fa47a353bb Reviewed-by: Mike Krus --- .../animationutils/tst_animationutils.cpp | 234 ++++++++++----------- .../channelmapping/tst_channelmapping.cpp | 8 +- .../tst_findrunningclipanimatorsjob.cpp | 4 +- .../qcallbackmapping/tst_qcallbackmapping.cpp | 6 +- .../qchannelmapping/tst_qchannelmapping.cpp | 12 +- .../quick3d/quick3dbuffer/tst_quick3dbuffer.cpp | 4 +- .../quick3d/quick3dnodeinstantiator/stringmodel.h | 4 +- .../tst_quick3dnodeinstantiator.cpp | 4 +- .../tst_alignedresourcesmanagers-sse.cpp | 4 +- tests/auto/render/gltfplugins/tst_gltfplugins.cpp | 12 +- .../tst_filtercompatibletechniquejob.cpp | 2 +- .../tst_graphicshelpergl3_2.cpp | 7 +- .../tst_graphicshelpergl3_3.cpp | 6 +- tests/auto/render/qray3d/tst_qray3d.cpp | 4 +- 14 files changed, 154 insertions(+), 157 deletions(-) (limited to 'tests') diff --git a/tests/auto/animation/animationutils/tst_animationutils.cpp b/tests/auto/animation/animationutils/tst_animationutils.cpp index 9fe5493aa..d08183976 100644 --- a/tests/auto/animation/animationutils/tst_animationutils.cpp +++ b/tests/auto/animation/animationutils/tst_animationutils.cpp @@ -289,34 +289,34 @@ private Q_SLOTS: QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); const QList channelMappings = { channelMapping }; // Create a few channels in the format description const ChannelNameAndType rotation = { QLatin1String("Rotation"), - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4, channelMapping->peerId() }; const ChannelNameAndType location = { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping->peerId() }; const ChannelNameAndType baseColor = { QLatin1String("BaseColor"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping->peerId() }; const ChannelNameAndType metalness = { QLatin1String("Metalness"), - static_cast(QVariant::Double), + static_cast(QMetaType::Double), 1, channelMapping->peerId() }; const ChannelNameAndType roughness = { QLatin1String("Roughness"), - static_cast(QVariant::Double), + static_cast(QMetaType::Double), 1, channelMapping->peerId() }; const ChannelNameAndType morphTargetWeightsList = { QLatin1String("MorphTargetWeightsList"), - static_cast(QVariant::List), + static_cast(QMetaType::QVariantList), 5, channelMapping->peerId() }; const ChannelNameAndType morphTargetWeightsVec = { QLatin1String("MorphTargetWeightsVec"), @@ -324,11 +324,11 @@ private Q_SLOTS: 6, channelMapping->peerId() }; const ChannelNameAndType rgbColor = { QLatin1String("rgbColor"), - static_cast(QVariant::Color), + static_cast(QMetaType::QColor), 3, channelMapping->peerId() }; const ChannelNameAndType rgbaColor = { QLatin1String("rgbaColor"), - static_cast(QVariant::Color), + static_cast(QMetaType::QColor), 4, channelMapping->peerId() }; @@ -385,42 +385,42 @@ private Q_SLOTS: QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); auto metalnessMapping = createChannelMapping(handler, QLatin1String("Metalness"), Qt3DCore::QNodeId::createId(), "metalness", - static_cast(QVariant::Double), + static_cast(QMetaType::Double), 1); auto baseColorMapping = createChannelMapping(handler, QLatin1String("BaseColor"), Qt3DCore::QNodeId::createId(), "baseColor", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); auto roughnessMapping = createChannelMapping(handler, QLatin1String("Roughness"), Qt3DCore::QNodeId::createId(), "roughness", - static_cast(QVariant::Double), + static_cast(QMetaType::Double), 1); auto rotationMapping = createChannelMapping(handler, QLatin1String("Rotation"), Qt3DCore::QNodeId::createId(), "rotation", - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4); auto morphTargetMapping = createChannelMapping(handler, QLatin1String("MorphTargetWeights"), Qt3DCore::QNodeId::createId(), "weights", - static_cast(QVariant::List), + static_cast(QMetaType::QVariantList), 5); @@ -431,27 +431,27 @@ private Q_SLOTS: // Create a few channels in the format description const ChannelNameAndType rotation = { QLatin1String("Rotation"), - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4, rotationMapping->peerId() }; const ChannelNameAndType location = { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, locationMapping->peerId() }; const ChannelNameAndType baseColor = { QLatin1String("BaseColor"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, baseColorMapping->peerId() }; const ChannelNameAndType metalness = { QLatin1String("Metalness"), - static_cast(QVariant::Double), + static_cast(QMetaType::Double), 1, metalnessMapping->peerId() }; const ChannelNameAndType roughness = { QLatin1String("Roughness"), - static_cast(QVariant::Double), + static_cast(QMetaType::Double), 1, roughnessMapping->peerId() }; const ChannelNameAndType morphTarget = { QLatin1String("MorphTargetWeights"), - static_cast(QVariant::List), + static_cast(QMetaType::QVariantList), 5, morphTargetMapping->peerId() }; const QList channelNamesAndTypes @@ -542,7 +542,7 @@ private Q_SLOTS: QList channelNamesAndTypes; for (int i = 0; i < jointCount; ++i) { ChannelNameAndType locationDescription = { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping->peerId() }; locationDescription.jointIndex = i; @@ -550,7 +550,7 @@ private Q_SLOTS: channelNamesAndTypes.push_back(locationDescription); ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4, channelMapping->peerId() }; rotationDescription.jointIndex = i; @@ -558,7 +558,7 @@ private Q_SLOTS: channelNamesAndTypes.push_back(rotationDescription); ChannelNameAndType scaleDescription = { QLatin1String("Scale"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping->peerId() }; scaleDescription.jointIndex = i; @@ -593,21 +593,21 @@ private Q_SLOTS: MappingData locationMapping; locationMapping.targetId = channelMapping->skeletonId(); locationMapping.propertyName = "translation"; - locationMapping.type = static_cast(QVariant::Vector3D); + locationMapping.type = static_cast(QMetaType::QVector3D); locationMapping.channelIndices = channelComponentIndices[componentIndicesIndex++]; locationMapping.jointIndex = i; MappingData rotationMapping; rotationMapping.targetId = channelMapping->skeletonId(); rotationMapping.propertyName = "rotation"; - rotationMapping.type = static_cast(QVariant::Quaternion); + rotationMapping.type = static_cast(QMetaType::QQuaternion); rotationMapping.channelIndices = channelComponentIndices[componentIndicesIndex++]; rotationMapping.jointIndex = i; MappingData scaleMapping; scaleMapping.targetId = channelMapping->skeletonId(); scaleMapping.propertyName = "scale"; - scaleMapping.type = static_cast(QVariant::Vector3D); + scaleMapping.type = static_cast(QMetaType::QVector3D); scaleMapping.channelIndices = channelComponentIndices[componentIndicesIndex++]; scaleMapping.jointIndex = i; @@ -809,7 +809,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "translation"; - mapping.type = static_cast(QVariant::Vector3D); + mapping.type = static_cast(QMetaType::QVector3D); mapping.channelIndices = QList { 0, 1, 2 }; mappingData.push_back(mapping); channelResults = QList { 1.0f, 2.0f, 3.0f }; @@ -837,14 +837,14 @@ private Q_SLOTS: MappingData translationMapping; translationMapping.targetId = Qt3DCore::QNodeId::createId(); translationMapping.propertyName = "translation"; - translationMapping.type = static_cast(QVariant::Vector3D); + translationMapping.type = static_cast(QMetaType::QVector3D); translationMapping.channelIndices = QList { 0, 1, 2 }; mappingData.push_back(translationMapping); MappingData scaleMapping; scaleMapping.targetId = Qt3DCore::QNodeId::createId(); scaleMapping.propertyName = "scale"; - scaleMapping.type = static_cast(QVariant::Vector3D); + scaleMapping.type = static_cast(QMetaType::QVector3D); scaleMapping.channelIndices = QList { 3, 4, 5 }; mappingData.push_back(scaleMapping); @@ -875,7 +875,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "mass"; - mapping.type = static_cast(QVariant::Double); + mapping.type = static_cast(QMetaType::Double); mapping.channelIndices = QList { 0 }; mappingData.push_back(mapping); channelResults = QList { 3.5f }; @@ -897,7 +897,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "pos"; - mapping.type = static_cast(QVariant::Vector2D); + mapping.type = static_cast(QMetaType::QVector2D); mapping.channelIndices = QList { 0, 1 }; mappingData.push_back(mapping); channelResults = QList { 2.0f, 1.0f }; @@ -919,7 +919,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "foo"; - mapping.type = static_cast(QVariant::Vector4D); + mapping.type = static_cast(QMetaType::QVector4D); mapping.channelIndices = QList { 0, 1, 2, 3 }; mappingData.push_back(mapping); channelResults = QList { 4.0f, 3.0f, 2.0f, 1.0f }; @@ -941,7 +941,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "rotation"; - mapping.type = static_cast(QVariant::Quaternion); + mapping.type = static_cast(QMetaType::QQuaternion); mapping.channelIndices = QList { 0, 1, 2, 3 }; mappingData.push_back(mapping); channelResults = QList { 1.0f, 0.0f, 0.0f, 1.0f }; @@ -963,7 +963,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "color"; - mapping.type = static_cast(QVariant::Color); + mapping.type = static_cast(QMetaType::QColor); mapping.channelIndices = QList { 0, 1, 2 }; mappingData.push_back(mapping); channelResults = QList { 0.5f, 0.4f, 0.3f }; @@ -985,7 +985,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "color"; - mapping.type = static_cast(QVariant::Color); + mapping.type = static_cast(QMetaType::QColor); mapping.channelIndices = QList { 0, 1, 2, 3 }; mappingData.push_back(mapping); channelResults = QList { 0.5f, 0.4f, 0.3f, 0.2f }; @@ -1007,7 +1007,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "weights"; - mapping.type = static_cast(QVariant::List); + mapping.type = static_cast(QMetaType::QVariantList); mapping.channelIndices = QList { 0, 1, 2, 3, 4, 5, 6 }; mappingData.push_back(mapping); channelResults = QList { 0.5f, 0.4f, 0.3f, 0.0f, 1.0f, 0.6f, 0.9f }; @@ -1066,7 +1066,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "translation"; - mapping.type = static_cast(QVariant::Vector3D); + mapping.type = static_cast(QMetaType::QVector3D); mapping.channelIndices = QList { 0, 1, 2 }; mapping.callback = &callback; mapping.callbackFlags = {}; @@ -1092,7 +1092,7 @@ private Q_SLOTS: MappingData mapping; mapping.targetId = Qt3DCore::QNodeId::createId(); mapping.propertyName = "something"; - mapping.type = static_cast(QVariant::Double); + mapping.type = static_cast(QMetaType::Double); mapping.channelIndices = QList { 0 }; mapping.callback = &callback; mapping.callbackFlags = {}; @@ -1425,7 +1425,7 @@ private Q_SLOTS: channel.channelComponents.resize(3); // leave 'name' empty - dataType = static_cast(QVariant::Vector3D); + dataType = static_cast(QMetaType::QVector3D); expectedChannelComponentCount = 3; offset = 0; // suffixes expected to be ignored @@ -1454,7 +1454,7 @@ private Q_SLOTS: channel.channelComponents[1].name = QLatin1String("Location Y"); channel.channelComponents[2].name = QLatin1String("Location Z"); - dataType = static_cast(QVariant::Vector3D); + dataType = static_cast(QMetaType::QVector3D); expectedChannelComponentCount = 3; offset = 0; suffixes = QList { 'X', 'Y', 'Z', 'W' }; @@ -1484,7 +1484,7 @@ private Q_SLOTS: channel.channelComponents[0].name = QLatin1String("pos X"); channel.channelComponents[1].name = QLatin1String("pos Y"); - dataType = static_cast(QVariant::Vector2D); + dataType = static_cast(QMetaType::QVector2D); expectedChannelComponentCount = 2; offset = 0; suffixes = QList { 'X', 'Y', 'Z', 'W' }; @@ -1516,7 +1516,7 @@ private Q_SLOTS: channel.channelComponents[2].name = QLatin1String("foo Z"); channel.channelComponents[3].name = QLatin1String("foo W"); - dataType = static_cast(QVariant::Vector4D); + dataType = static_cast(QMetaType::QVector4D); expectedChannelComponentCount = 4; offset = 0; suffixes = QList { 'X', 'Y', 'Z', 'W' }; @@ -1545,7 +1545,7 @@ private Q_SLOTS: channel.channelComponents.resize(1); channel.channelComponents[0].name = QLatin1String("Mass X"); - dataType = static_cast(QVariant::Double); + dataType = static_cast(QMetaType::Double); expectedChannelComponentCount = 1; offset = 0; suffixes = QList { 'X', 'Y', 'Z', 'W' }; @@ -1577,7 +1577,7 @@ private Q_SLOTS: channel.channelComponents[2].name = QLatin1String("Rotation Y"); channel.channelComponents[3].name = QLatin1String("Rotation Z"); - dataType = static_cast(QVariant::Quaternion); + dataType = static_cast(QMetaType::QQuaternion); expectedChannelComponentCount = 4; offset = 0; suffixes = QList { 'W', 'X', 'Y', 'Z' }; @@ -1609,7 +1609,7 @@ private Q_SLOTS: channel.channelComponents[2].name = QLatin1String("Rotation Z"); channel.channelComponents[3].name = QLatin1String("Rotation Y"); - dataType = static_cast(QVariant::Quaternion); + dataType = static_cast(QMetaType::QQuaternion); expectedChannelComponentCount = 4; offset = 0; suffixes = QList { 'W', 'X', 'Y', 'Z' }; @@ -1640,7 +1640,7 @@ private Q_SLOTS: channel.channelComponents[1].name = QLatin1String("Color G"); channel.channelComponents[2].name = QLatin1String("Color B"); - dataType = static_cast(QVariant::Color); + dataType = static_cast(QMetaType::QColor); expectedChannelComponentCount = 3; offset = 0; suffixes = QList { 'R', 'G', 'B' }; @@ -1672,7 +1672,7 @@ private Q_SLOTS: channel.channelComponents[2].name = QLatin1String("Color B"); channel.channelComponents[3].name = QLatin1String("Color A"); - dataType = static_cast(QVariant::Color); + dataType = static_cast(QMetaType::QColor); expectedChannelComponentCount = 4; offset = 0; suffixes = QList { 'R', 'G', 'B', 'A' }; @@ -1701,7 +1701,7 @@ private Q_SLOTS: channel.channelComponents.resize(6); // leave channel component names empty - dataType = static_cast(QVariant::List); + dataType = static_cast(QMetaType::QVariantList); expectedChannelComponentCount = 6; offset = 0; // suffixes expected to be ignored @@ -1793,7 +1793,7 @@ private Q_SLOTS: channel.channelComponents[2].name = QLatin1String("Rotation Y"); channel.channelComponents[3].name = QLatin1String("Rotation Z"); - dataType = static_cast(QVariant::Quaternion); + dataType = static_cast(QMetaType::QQuaternion); componentCount = 4; offset = 0; expectedResults = QList { 0, 1, 2, 3 }; @@ -1820,7 +1820,7 @@ private Q_SLOTS: channel.channelComponents[1].name = QLatin1String("Location Y"); channel.channelComponents[2].name = QLatin1String("Location Z"); - dataType = static_cast(QVariant::Vector3D); + dataType = static_cast(QMetaType::QVector3D); componentCount = 3; offset = 0; expectedResults = QList { 0, 1, 2 }; @@ -1847,7 +1847,7 @@ private Q_SLOTS: channel.channelComponents[1].name = QLatin1String("Color G"); channel.channelComponents[2].name = QLatin1String("Color B"); - dataType = static_cast(QVariant::Color); + dataType = static_cast(QMetaType::QColor); componentCount = 3; offset = 0; expectedResults = QList { 0, 1, 2 }; @@ -1874,7 +1874,7 @@ private Q_SLOTS: channel.channelComponents[2].name = QLatin1String("Color B"); channel.channelComponents[3].name = QLatin1String("Color A"); - dataType = static_cast(QVariant::Color); + dataType = static_cast(QMetaType::QColor); componentCount = 4; offset = 0; expectedResults = QList { 0, 1, 2, 3 }; @@ -2648,14 +2648,14 @@ private Q_SLOTS: QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); auto channelMapper = createChannelMapper(handler, QList { channelMapping->peerId() }); const QList expectedResults = { { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping->peerId() } }; @@ -2669,13 +2669,13 @@ private Q_SLOTS: QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); auto channelMapping2 = createChannelMapping(handler, QLatin1String("Rotation"), Qt3DCore::QNodeId::createId(), "rotation", - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4); const QList channelMappingIds @@ -2684,11 +2684,11 @@ private Q_SLOTS: const QList expectedResults = { { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping1->peerId() }, { QLatin1String("Rotation"), - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4, channelMapping2->peerId() } }; @@ -2702,25 +2702,25 @@ private Q_SLOTS: QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); auto channelMapping2 = createChannelMapping(handler, QLatin1String("Rotation"), Qt3DCore::QNodeId::createId(), "rotation", - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4); auto channelMapping3 = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); auto channelMapping4 = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); const QList channelMappingIds @@ -2730,19 +2730,19 @@ private Q_SLOTS: QList expectedResults = { { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping1->peerId() }, { QLatin1String("Rotation"), - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4, channelMapping2->peerId() }, { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping3->peerId() }, { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping4->peerId() } }; @@ -2761,7 +2761,7 @@ private Q_SLOTS: QList expectedResults; for (int i = 0; i < jointCount; ++i) { ChannelNameAndType locationDescription = { QLatin1String("Location"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping->peerId() }; locationDescription.jointIndex = i; @@ -2769,7 +2769,7 @@ private Q_SLOTS: expectedResults.push_back(locationDescription); ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4, channelMapping->peerId() }; rotationDescription.jointIndex = i; @@ -2777,7 +2777,7 @@ private Q_SLOTS: expectedResults.push_back(rotationDescription); ChannelNameAndType scaleDescription = { QLatin1String("Scale"), - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3, channelMapping->peerId() }; scaleDescription.jointIndex = i; @@ -2815,7 +2815,7 @@ private Q_SLOTS: { const QList allChannels = { - { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 } + { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 } }; const QList expectedResults = { { 0, 1, 2 } }; @@ -2825,8 +2825,8 @@ private Q_SLOTS: { const QList allChannels = { - { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Rotation"), static_cast(QVariant::Quaternion), 4 } + { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 } }; const QList expectedResults = { { 0, 1, 2 }, @@ -2837,12 +2837,12 @@ private Q_SLOTS: { const QList allChannels = { - { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Rotation"), static_cast(QVariant::Quaternion), 4 }, - { QLatin1String("BaseColor"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Metalness"), static_cast(QVariant::Double), 1 }, - { QLatin1String("Roughness"), static_cast(QVariant::Double), 1 }, - { QLatin1String("MorphWeights"), static_cast(QVariant::List), 6 } + { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, + { QLatin1String("BaseColor"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Metalness"), static_cast(QMetaType::Double), 1 }, + { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 }, + { QLatin1String("MorphWeights"), static_cast(QMetaType::QVariantList), 6 } }; const QList expectedResults = { @@ -2860,15 +2860,15 @@ private Q_SLOTS: QList allChannels; const int jointCount = 4; for (int i = 0; i < jointCount; ++i) { - ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 }; + ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }; locationDescription.jointIndex = i; allChannels.push_back(locationDescription); - ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), static_cast(QVariant::Quaternion), 4 }; + ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }; rotationDescription.jointIndex = i; allChannels.push_back(rotationDescription); - ChannelNameAndType scaleDescription = { QLatin1String("Scale"), static_cast(QVariant::Vector3D), 3 }; + ChannelNameAndType scaleDescription = { QLatin1String("Scale"), static_cast(QMetaType::QVector3D), 3 }; scaleDescription.jointIndex = i; allChannels.push_back(scaleDescription); } @@ -2913,11 +2913,11 @@ private Q_SLOTS: { const QList targetChannels = { - { QLatin1String("Rotation"), static_cast(QVariant::Quaternion), 4 }, - { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Base Color"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Metalness"), static_cast(QVariant::Double), 1 }, - { QLatin1String("Roughness"), static_cast(QVariant::Double), 1 } + { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, + { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Base Color"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Metalness"), static_cast(QMetaType::Double), 1 }, + { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 } }; const QList targetIndices = { @@ -2953,11 +2953,11 @@ private Q_SLOTS: { const QList targetChannels = { - { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Rotation"), static_cast(QVariant::Quaternion), 4 }, - { QLatin1String("Base Color"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Metalness"), static_cast(QVariant::Double), 1 }, - { QLatin1String("Roughness"), static_cast(QVariant::Double), 1 } + { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, + { QLatin1String("Base Color"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Metalness"), static_cast(QMetaType::Double), 1 }, + { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 } }; const QList targetIndices = { @@ -2993,11 +2993,11 @@ private Q_SLOTS: { const QList targetChannels = { - { QLatin1String("Rotation"), static_cast(QVariant::Quaternion), 4 }, - { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Albedo"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Metalness"), static_cast(QVariant::Double), 1 }, - { QLatin1String("Roughness"), static_cast(QVariant::Double), 1 } + { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, + { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Albedo"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Metalness"), static_cast(QMetaType::Double), 1 }, + { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 } }; const QList targetIndices = { @@ -3033,11 +3033,11 @@ private Q_SLOTS: { const QList targetChannels = { - { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Rotation"), static_cast(QVariant::Quaternion), 4 }, - { QLatin1String("Albedo"), static_cast(QVariant::Vector3D), 3 }, - { QLatin1String("Metalness"), static_cast(QVariant::Double), 1 }, - { QLatin1String("Roughness"), static_cast(QVariant::Double), 1 } + { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }, + { QLatin1String("Albedo"), static_cast(QMetaType::QVector3D), 3 }, + { QLatin1String("Metalness"), static_cast(QMetaType::Double), 1 }, + { QLatin1String("Roughness"), static_cast(QMetaType::Double), 1 } }; const QList targetIndices = { @@ -3075,15 +3075,15 @@ private Q_SLOTS: QList targetChannels; const int jointCount = 4; for (int i = 0; i < jointCount; ++i) { - ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast(QVariant::Vector3D), 3 }; + ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast(QMetaType::QVector3D), 3 }; locationDescription.jointIndex = i; targetChannels.push_back(locationDescription); - ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), static_cast(QVariant::Quaternion), 4 }; + ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), static_cast(QMetaType::QQuaternion), 4 }; rotationDescription.jointIndex = i; targetChannels.push_back(rotationDescription); - ChannelNameAndType scaleDescription = { QLatin1String("Scale"), static_cast(QVariant::Vector3D), 3 }; + ChannelNameAndType scaleDescription = { QLatin1String("Scale"), static_cast(QMetaType::QVector3D), 3 }; scaleDescription.jointIndex = i; targetChannels.push_back(scaleDescription); } @@ -3179,11 +3179,11 @@ private Q_SLOTS: QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Vector3D); + channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.name = QLatin1String("translation"); const QList expectedResults = { 0.0f, 0.0f, 0.0f }; QTest::newRow("translation") << handler << channelDescription << expectedResults; @@ -3195,11 +3195,11 @@ private Q_SLOTS: QLatin1String("Rotation"), Qt3DCore::QNodeId::createId(), "rotation", - static_cast(QVariant::Quaternion), + static_cast(QMetaType::QQuaternion), 4); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Quaternion); + channelDescription.type = static_cast(QMetaType::QQuaternion); channelDescription.name = QLatin1String("rotation"); const QList expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; QTest::newRow("rotation") << handler << channelDescription << expectedResults; @@ -3211,11 +3211,11 @@ private Q_SLOTS: QLatin1String("Scale"), Qt3DCore::QNodeId::createId(), "scale", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Vector3D); + channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.name = QLatin1String("scale"); const QList expectedResults = { 1.0f, 1.0f, 1.0f }; QTest::newRow("scale") << handler << channelDescription << expectedResults; @@ -3230,7 +3230,7 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, skeleton->peerId()); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Vector3D); + channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Scale; const QList expectedResults = { 2.0f, 3.0f, 4.0f }; @@ -3245,7 +3245,7 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, skeleton->peerId()); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Vector3D); + channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Rotation; const QList expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; @@ -3260,7 +3260,7 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, skeleton->peerId()); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Vector3D); + channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.jointIndex = 0; channelDescription.jointTransformComponent = Translation; const QList expectedResults = { 2.0f, 3.0f, 4.0f }; @@ -3275,7 +3275,7 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, skeleton->peerId()); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Vector3D); + channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Scale; const QList expectedResults = { 20.0f, 30.0f, 40.0f }; @@ -3290,7 +3290,7 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, skeleton->peerId()); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Vector3D); + channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Rotation; const QList expectedResults = { 1.0f, 0.0f, 0.0f, 0.0f }; @@ -3305,7 +3305,7 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, skeleton->peerId()); ChannelNameAndType channelDescription; channelDescription.mappingId = channelMapping->peerId(); - channelDescription.type = static_cast(QVariant::Vector3D); + channelDescription.type = static_cast(QMetaType::QVector3D); channelDescription.jointIndex = 1; channelDescription.jointTransformComponent = Translation; const QList expectedResults = { 4.0f, 5.0f, 6.0f }; diff --git a/tests/auto/animation/channelmapping/tst_channelmapping.cpp b/tests/auto/animation/channelmapping/tst_channelmapping.cpp index 9bee116d4..8e4152c09 100644 --- a/tests/auto/animation/channelmapping/tst_channelmapping.cpp +++ b/tests/auto/animation/channelmapping/tst_channelmapping.cpp @@ -82,7 +82,7 @@ private Q_SLOTS: QVERIFY(qstrcmp(backendMapping.propertyName(), mapping.property().toLatin1().constData()) == 0); QVERIFY(qstrcmp(backendMapping.propertyName(), "foo") == 0); QCOMPARE(backendMapping.componentCount(), 2); - QCOMPARE(backendMapping.type(), static_cast(QVariant::Vector2D)); + QCOMPARE(backendMapping.type(), static_cast(QMetaType::QVector2D)); QCOMPARE(backendMapping.mappingType(), Qt3DAnimation::Animation::ChannelMapping::ChannelMappingType); // GIVEN @@ -116,7 +116,7 @@ private Q_SLOTS: QCOMPARE(backendMapping.targetId(), Qt3DCore::QNodeId()); QCOMPARE(backendMapping.propertyName(), nullptr); QCOMPARE(backendMapping.componentCount(), 0); - QCOMPARE(backendMapping.type(), static_cast(QVariant::Invalid)); + QCOMPARE(backendMapping.type(), static_cast(QMetaType::UnknownType)); QCOMPARE(backendMapping.skeletonId(), Qt3DCore::QNodeId()); QCOMPARE(backendMapping.mappingType(), Qt3DAnimation::Animation::ChannelMapping::ChannelMappingType); @@ -138,7 +138,7 @@ private Q_SLOTS: QCOMPARE(backendMapping.targetId(), Qt3DCore::QNodeId()); QCOMPARE(backendMapping.propertyName(), nullptr); QCOMPARE(backendMapping.componentCount(), 0); - QCOMPARE(backendMapping.type(), static_cast(QVariant::Invalid)); + QCOMPARE(backendMapping.type(), static_cast(QMetaType::UnknownType)); QCOMPARE(backendMapping.skeletonId(), Qt3DCore::QNodeId()); QCOMPARE(backendMapping.mappingType(), Qt3DAnimation::Animation::ChannelMapping::ChannelMappingType); } @@ -175,7 +175,7 @@ private Q_SLOTS: // THEN QCOMPARE(backendMapping.targetId(), target->id()); - QCOMPARE(backendMapping.type(), static_cast(QVariant::Vector3D)); + QCOMPARE(backendMapping.type(), static_cast(QMetaType::QVector3D)); QCOMPARE(backendMapping.componentCount(), 3); const char *testName = "translation"; diff --git a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp index b3d6744f2..aea512f1c 100644 --- a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp +++ b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp @@ -140,7 +140,7 @@ private Q_SLOTS: QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); channelMapper = createChannelMapper(handler, QList { channelMapping->peerId() }); animator->setMapperId(channelMapper->peerId()); @@ -181,7 +181,7 @@ private Q_SLOTS: QLatin1String("Location"), Qt3DCore::QNodeId::createId(), "translation", - static_cast(QVariant::Vector3D), + static_cast(QMetaType::QVector3D), 3); channelMapper = createChannelMapper(handler, QList { channelMapping->peerId() }); animator->setMapperId(channelMapper->peerId()); diff --git a/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp b/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp index 5037937a1..c9ec159d7 100644 --- a/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp +++ b/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp @@ -83,7 +83,7 @@ private Q_SLOTS: { // WHEN auto newValue = new DummyCallback(); - mapping.setCallback(QVariant::Quaternion, newValue); + mapping.setCallback(QMetaType::QQuaternion, newValue); // THEN - no signals for callback QCOMPARE(mapping.callback(), newValue); @@ -117,7 +117,7 @@ private Q_SLOTS: { // WHEN auto callback = new DummyCallback(); - mapping.setCallback(QVariant::Vector3D, callback, Qt3DAnimation::QAnimationCallback::OnThreadPool); + mapping.setCallback(QMetaType::QVector3D, callback, Qt3DAnimation::QAnimationCallback::OnThreadPool); QCoreApplication::processEvents(); // THEN @@ -127,7 +127,7 @@ private Q_SLOTS: arbiter.clear(); // WHEN - mapping.setCallback(QVariant::Vector3D, callback, Qt3DAnimation::QAnimationCallback::OnThreadPool); + mapping.setCallback(QMetaType::QVector3D, callback, Qt3DAnimation::QAnimationCallback::OnThreadPool); QCoreApplication::processEvents(); // THEN diff --git a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp index 10283d0d6..dd40192b8 100644 --- a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp +++ b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp @@ -95,7 +95,7 @@ private Q_SLOTS: static_cast( Qt3DAnimation::QChannelMappingPrivate::get(&mapping)); - QCOMPARE(d->m_type, static_cast(QVariant::Invalid)); + QCOMPARE(d->m_type, static_cast(QMetaType::UnknownType)); QCOMPARE(d->m_componentCount, 0); } @@ -237,13 +237,13 @@ private Q_SLOTS: QTest::addColumn("expectedComponentCount"); QTest::newRow("float") << QByteArrayLiteral("floatProperty") << QVariant(1.0f) << static_cast(QMetaType::Float) << 1; - QTest::newRow("vec2") << QByteArrayLiteral("vec2Property") << QVariant(QVector2D(1.0f, 1.0f)) << static_cast(QVariant::Vector2D) << 2; - QTest::newRow("vec3") << QByteArrayLiteral("vec3Property") << QVariant(QVector3D(1.0f, 1.0f, 1.0f)) << static_cast(QVariant::Vector3D) << 3; - QTest::newRow("vec4") << QByteArrayLiteral("vec4Property") << QVariant(QVector4D(1.0f, 1.0f, 1.0f, 1.0f)) << static_cast(QVariant::Vector4D) << 4; - QTest::newRow("quaternion") << QByteArrayLiteral("quaternionProperty") << QVariant(QQuaternion(1.0f, 1.0f, 1.0f, 1.0f)) << static_cast(QVariant::Quaternion) << 4; + QTest::newRow("vec2") << QByteArrayLiteral("vec2Property") << QVariant(QVector2D(1.0f, 1.0f)) << static_cast(QMetaType::QVector2D) << 2; + QTest::newRow("vec3") << QByteArrayLiteral("vec3Property") << QVariant(QVector3D(1.0f, 1.0f, 1.0f)) << static_cast(QMetaType::QVector3D) << 3; + QTest::newRow("vec4") << QByteArrayLiteral("vec4Property") << QVariant(QVector4D(1.0f, 1.0f, 1.0f, 1.0f)) << static_cast(QMetaType::QVector4D) << 4; + QTest::newRow("quaternion") << QByteArrayLiteral("quaternionProperty") << QVariant(QQuaternion(1.0f, 1.0f, 1.0f, 1.0f)) << static_cast(QMetaType::QQuaternion) << 4; QVariantList list = QVariantList() << QVariant(1.0f) << QVariant(1.0) << QVariant(1.0f) << QVariant(1.0f) << QVariant(1.0f); - QTest::newRow("variantlist") << QByteArrayLiteral("listProperty") << QVariant::fromValue(list) << static_cast(QVariant::List) << 5; + QTest::newRow("variantlist") << QByteArrayLiteral("listProperty") << QVariant::fromValue(list) << static_cast(QMetaType::QVariantList) << 5; QList vec(8); QTest::newRow("vector") << QByteArrayLiteral("vecProperty") << QVariant::fromValue(vec) << qMetaTypeId() << 8; diff --git a/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp b/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp index fccf5f13f..d59040c80 100644 --- a/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp +++ b/tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp @@ -59,7 +59,7 @@ private Q_SLOTS: QVariant data = buf.readBinaryFile(QUrl::fromLocalFile(QLatin1String("this_should_not_exist.bin"))); // THEN - QCOMPARE(data.userType(), static_cast(QVariant::ByteArray)); + QCOMPARE(data.userType(), static_cast(QMetaType::QByteArray)); QVERIFY(data.value().isEmpty()); } @@ -80,7 +80,7 @@ private Q_SLOTS: QVariant data = buf.readBinaryFile(path); // THEN - QCOMPARE(data.userType(), static_cast(QVariant::ByteArray)); + QCOMPARE(data.userType(), static_cast(QMetaType::QByteArray)); const QByteArray byteArray = data.value(); QCOMPARE(byteArray.size(), bufferByteSize); QVERIFY(memcmp(byteArray, dataArray.constData(), bufferByteSize) == 0); diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h b/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h index b928b2ab8..d21d46831 100644 --- a/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h +++ b/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h @@ -84,7 +84,7 @@ public: QModelIndex index(int row, int column, const QModelIndex &parent) const override { Q_UNUSED(column); - if (row>=0 && row= 0 && row < rowCount(parent)) return createIndex(row,0); else return QModelIndex(); @@ -99,7 +99,7 @@ public: { int row = index.row(); if ((row<0) || (row>=items.count())) - return QVariant::Invalid; + return int(QMetaType::UnknownType); switch (role) { case Qt::DisplayRole: diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp index 76568d67d..0071a2aad 100644 --- a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp +++ b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp @@ -237,11 +237,11 @@ void tst_quick3dnodeinstantiator::createAndRemove() StringModel *model = new StringModel("model1"); engine.rootContext()->setContextProperty("model1", model); QObject *rootObject = component.create(); - QVERIFY(rootObject != 0); + QVERIFY(rootObject != nullptr); Quick3DNodeInstantiator *instantiator = qobject_cast(rootObject->findChild("instantiator1")); - QVERIFY(instantiator != 0); + QVERIFY(instantiator != nullptr); model->drop(1); const QList names = { "Beta", "Gamma", "Delta" }; for (int i = 0; i < 3; i++) { diff --git a/tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp b/tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp index 48efef4b7..a6ee70e20 100644 --- a/tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp +++ b/tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp @@ -75,7 +75,7 @@ private Q_SLOTS: // Shouldn't crash const std::vector &activeHandles = manager.activeHandles(); - for (const HMatrix handle : activeHandles) { + for (const HMatrix &handle : activeHandles) { // WHEN Matrix4x4_SSE *mat = manager.data(handle); // THEN @@ -109,7 +109,7 @@ private Q_SLOTS: // Shouldn't crash const std::vector &activeHandles = manager.activeHandles(); - for (const HCameraLens handle : activeHandles) { + for (const HCameraLens &handle : activeHandles) { // WHEN Qt3DRender::Render::CameraLens *lens = manager.data(handle); // THEN diff --git a/tests/auto/render/gltfplugins/tst_gltfplugins.cpp b/tests/auto/render/gltfplugins/tst_gltfplugins.cpp index 7f00f9fbb..751aa814a 100644 --- a/tests/auto/render/gltfplugins/tst_gltfplugins.cpp +++ b/tests/auto/render/gltfplugins/tst_gltfplugins.cpp @@ -789,15 +789,15 @@ 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 (v1.type() == QVariant::Bool) { + if (v1.metaType().id() == QMetaType::Bool) { QCOMPARE(v1.toBool(), v2.toBool()); - } else if (v1.type() == QVariant::Color) { + } else if (v1.metaType().id() == QMetaType::QColor) { QCOMPARE(v1.value(), v2.value()); - } else if (v1.type() == QVariant::Vector3D) { + } else if (v1.metaType().id() == QMetaType::QVector3D) { QCOMPARE(v1.value(), v2.value()); - } else if (v1.type() == QVariant::Matrix4x4) { + } else if (v1.metaType().id() == QMetaType::QMatrix4x4) { QCOMPARE(v1.value(), v2.value()); - } else if (v1.canConvert(QMetaType::Float)) { + } else if (QMetaType::canConvert(v1.metaType(), QMetaType(QMetaType::Float))) { QVERIFY(qFuzzyCompare(v1.toFloat(), v2.toFloat())); } } @@ -879,7 +879,7 @@ void tst_gltfPlugins::compareParameters(const QList &p for (auto p2 : params2) { if (p1->name() == p2->name()) { pMatch = true; - if (p1->value().type() == QVariant::Color) { + if (p1->value().metaType().id() == QMetaType::QColor) { // Colors are imported as QVector4Ds QColor color = p1->value().value(); QVector4D vec = p2->value().value(); diff --git a/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp b/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp index 8b9144c66..3a4d5f021 100644 --- a/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp +++ b/tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp @@ -252,7 +252,7 @@ private Q_SLOTS: // Check at least one technique is valid bool foundValid = false; - for (const auto handle: handles) { + for (const auto &handle: handles) { Qt3DRender::Render::Technique *technique = testAspect.nodeManagers()->techniqueManager()->data(handle); foundValid |= technique->isCompatibleWithRenderer(); } 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 21335e541..c21def5cd 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp @@ -553,9 +553,8 @@ private Q_SLOTS: textures[3]->bind(); m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); - for (const QVector4D c : colors) { + for (const QVector4D &c : colors) QVERIFY(c == clearValue1); - } // WHEN const QVector4D clearValue2 = QVector4D(0.4f, 0.5f, 0.4f, 1.0f); @@ -565,9 +564,9 @@ private Q_SLOTS: textures[3]->bind(); m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); - for (const QVector4D c : colors) { + for (const QVector4D &c : colors) QVERIFY(c == clearValue2); - } + // Restore m_func->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); m_func->glDeleteFramebuffers(1, &fboId); 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 63a256dc0..745e3e4af 100644 --- a/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp +++ b/tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp @@ -652,9 +652,8 @@ private Q_SLOTS: m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); - for (const QVector4D c : colors) { + for (const QVector4D &c : colors) QVERIFY(c == clearValue1); - } // WHEN const QVector4D clearValue2 = QVector4D(0.4f, 0.5f, 0.4f, 1.0f); @@ -664,9 +663,8 @@ private Q_SLOTS: textures[3]->bind(); m_func->glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, colors.data()); textures[3]->release(); - for (const QVector4D c : colors) { + for (const QVector4D &c : colors) QVERIFY(c == clearValue2); - } // Restore m_func->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); m_func->glDeleteFramebuffers(1, &fboId); diff --git a/tests/auto/render/qray3d/tst_qray3d.cpp b/tests/auto/render/qray3d/tst_qray3d.cpp index ef0702a0a..7f8f934c6 100644 --- a/tests/auto/render/qray3d/tst_qray3d.cpp +++ b/tests/auto/render/qray3d/tst_qray3d.cpp @@ -517,8 +517,8 @@ void tst_QRay3D::properties() void tst_QRay3D::metaTypes() { int id = qMetaTypeId(); - QVERIFY(QMetaType::type("Qt3DRender::RayCasting::QRay3D") == id); - QCOMPARE(QByteArray(QMetaType::typeName(id)), QByteArray("Qt3DRender::RayCasting::QRay3D")); + QVERIFY(QMetaType::fromName("Qt3DRender::RayCasting::QRay3D").id() == id); + QCOMPARE(QByteArray(QMetaType(id).name()), QByteArray("Qt3DRender::RayCasting::QRay3D")); QVERIFY(QMetaType::isRegistered(id)); } -- cgit v1.2.3