summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-11-14 14:42:32 +0000
committerMike Krus <mike.krus@kdab.com>2020-11-20 14:58:05 +0000
commitb0dbd67d7b95cb4c74a502e04b68e3b3f9dc8e6b (patch)
tree36ee62c2f9ee0e5aea7c298510e94a14ec1c920a /tests
parentba9827ab5de200756f5c2c0899fc01f1d573eae2 (diff)
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 <mike.krus@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/animation/animationutils/tst_animationutils.cpp234
-rw-r--r--tests/auto/animation/channelmapping/tst_channelmapping.cpp8
-rw-r--r--tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp4
-rw-r--r--tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp6
-rw-r--r--tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp12
-rw-r--r--tests/auto/quick3d/quick3dbuffer/tst_quick3dbuffer.cpp4
-rw-r--r--tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h4
-rw-r--r--tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp4
-rw-r--r--tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp4
-rw-r--r--tests/auto/render/gltfplugins/tst_gltfplugins.cpp12
-rw-r--r--tests/auto/render/opengl/filtercompatibletechniquejob/tst_filtercompatibletechniquejob.cpp2
-rw-r--r--tests/auto/render/opengl/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp7
-rw-r--r--tests/auto/render/opengl/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp6
-rw-r--r--tests/auto/render/qray3d/tst_qray3d.cpp4
14 files changed, 154 insertions, 157 deletions
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<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
const QList<ChannelMapping *> channelMappings = { channelMapping };
// Create a few channels in the format description
const ChannelNameAndType rotation = { QLatin1String("Rotation"),
- static_cast<int>(QVariant::Quaternion),
+ static_cast<int>(QMetaType::QQuaternion),
4,
channelMapping->peerId() };
const ChannelNameAndType location = { QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
channelMapping->peerId() };
const ChannelNameAndType baseColor = { QLatin1String("BaseColor"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
channelMapping->peerId() };
const ChannelNameAndType metalness = { QLatin1String("Metalness"),
- static_cast<int>(QVariant::Double),
+ static_cast<int>(QMetaType::Double),
1,
channelMapping->peerId() };
const ChannelNameAndType roughness = { QLatin1String("Roughness"),
- static_cast<int>(QVariant::Double),
+ static_cast<int>(QMetaType::Double),
1,
channelMapping->peerId() };
const ChannelNameAndType morphTargetWeightsList = { QLatin1String("MorphTargetWeightsList"),
- static_cast<int>(QVariant::List),
+ static_cast<int>(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<int>(QVariant::Color),
+ static_cast<int>(QMetaType::QColor),
3,
channelMapping->peerId() };
const ChannelNameAndType rgbaColor = { QLatin1String("rgbaColor"),
- static_cast<int>(QVariant::Color),
+ static_cast<int>(QMetaType::QColor),
4,
channelMapping->peerId() };
@@ -385,42 +385,42 @@ private Q_SLOTS:
QLatin1String("Location"),
Qt3DCore::QNodeId::createId(),
"translation",
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
auto metalnessMapping = createChannelMapping(handler,
QLatin1String("Metalness"),
Qt3DCore::QNodeId::createId(),
"metalness",
- static_cast<int>(QVariant::Double),
+ static_cast<int>(QMetaType::Double),
1);
auto baseColorMapping = createChannelMapping(handler,
QLatin1String("BaseColor"),
Qt3DCore::QNodeId::createId(),
"baseColor",
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
auto roughnessMapping = createChannelMapping(handler,
QLatin1String("Roughness"),
Qt3DCore::QNodeId::createId(),
"roughness",
- static_cast<int>(QVariant::Double),
+ static_cast<int>(QMetaType::Double),
1);
auto rotationMapping = createChannelMapping(handler,
QLatin1String("Rotation"),
Qt3DCore::QNodeId::createId(),
"rotation",
- static_cast<int>(QVariant::Quaternion),
+ static_cast<int>(QMetaType::QQuaternion),
4);
auto morphTargetMapping = createChannelMapping(handler,
QLatin1String("MorphTargetWeights"),
Qt3DCore::QNodeId::createId(),
"weights",
- static_cast<int>(QVariant::List),
+ static_cast<int>(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<int>(QVariant::Quaternion),
+ static_cast<int>(QMetaType::QQuaternion),
4,
rotationMapping->peerId() };
const ChannelNameAndType location = { QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
locationMapping->peerId() };
const ChannelNameAndType baseColor = { QLatin1String("BaseColor"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
baseColorMapping->peerId() };
const ChannelNameAndType metalness = { QLatin1String("Metalness"),
- static_cast<int>(QVariant::Double),
+ static_cast<int>(QMetaType::Double),
1,
metalnessMapping->peerId() };
const ChannelNameAndType roughness = { QLatin1String("Roughness"),
- static_cast<int>(QVariant::Double),
+ static_cast<int>(QMetaType::Double),
1,
roughnessMapping->peerId() };
const ChannelNameAndType morphTarget = { QLatin1String("MorphTargetWeights"),
- static_cast<int>(QVariant::List),
+ static_cast<int>(QMetaType::QVariantList),
5,
morphTargetMapping->peerId() };
const QList<ChannelNameAndType> channelNamesAndTypes
@@ -542,7 +542,7 @@ private Q_SLOTS:
QList<ChannelNameAndType> channelNamesAndTypes;
for (int i = 0; i < jointCount; ++i) {
ChannelNameAndType locationDescription = { QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(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<int>(QVariant::Quaternion),
+ static_cast<int>(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<int>(QVariant::Vector3D),
+ static_cast<int>(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<int>(QVariant::Vector3D);
+ locationMapping.type = static_cast<int>(QMetaType::QVector3D);
locationMapping.channelIndices = channelComponentIndices[componentIndicesIndex++];
locationMapping.jointIndex = i;
MappingData rotationMapping;
rotationMapping.targetId = channelMapping->skeletonId();
rotationMapping.propertyName = "rotation";
- rotationMapping.type = static_cast<int>(QVariant::Quaternion);
+ rotationMapping.type = static_cast<int>(QMetaType::QQuaternion);
rotationMapping.channelIndices = channelComponentIndices[componentIndicesIndex++];
rotationMapping.jointIndex = i;
MappingData scaleMapping;
scaleMapping.targetId = channelMapping->skeletonId();
scaleMapping.propertyName = "scale";
- scaleMapping.type = static_cast<int>(QVariant::Vector3D);
+ scaleMapping.type = static_cast<int>(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<int>(QVariant::Vector3D);
+ mapping.type = static_cast<int>(QMetaType::QVector3D);
mapping.channelIndices = QList<int> { 0, 1, 2 };
mappingData.push_back(mapping);
channelResults = QList<float> { 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<int>(QVariant::Vector3D);
+ translationMapping.type = static_cast<int>(QMetaType::QVector3D);
translationMapping.channelIndices = QList<int> { 0, 1, 2 };
mappingData.push_back(translationMapping);
MappingData scaleMapping;
scaleMapping.targetId = Qt3DCore::QNodeId::createId();
scaleMapping.propertyName = "scale";
- scaleMapping.type = static_cast<int>(QVariant::Vector3D);
+ scaleMapping.type = static_cast<int>(QMetaType::QVector3D);
scaleMapping.channelIndices = QList<int> { 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<int>(QVariant::Double);
+ mapping.type = static_cast<int>(QMetaType::Double);
mapping.channelIndices = QList<int> { 0 };
mappingData.push_back(mapping);
channelResults = QList<float> { 3.5f };
@@ -897,7 +897,7 @@ private Q_SLOTS:
MappingData mapping;
mapping.targetId = Qt3DCore::QNodeId::createId();
mapping.propertyName = "pos";
- mapping.type = static_cast<int>(QVariant::Vector2D);
+ mapping.type = static_cast<int>(QMetaType::QVector2D);
mapping.channelIndices = QList<int> { 0, 1 };
mappingData.push_back(mapping);
channelResults = QList<float> { 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<int>(QVariant::Vector4D);
+ mapping.type = static_cast<int>(QMetaType::QVector4D);
mapping.channelIndices = QList<int> { 0, 1, 2, 3 };
mappingData.push_back(mapping);
channelResults = QList<float> { 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<int>(QVariant::Quaternion);
+ mapping.type = static_cast<int>(QMetaType::QQuaternion);
mapping.channelIndices = QList<int> { 0, 1, 2, 3 };
mappingData.push_back(mapping);
channelResults = QList<float> { 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<int>(QVariant::Color);
+ mapping.type = static_cast<int>(QMetaType::QColor);
mapping.channelIndices = QList<int> { 0, 1, 2 };
mappingData.push_back(mapping);
channelResults = QList<float> { 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<int>(QVariant::Color);
+ mapping.type = static_cast<int>(QMetaType::QColor);
mapping.channelIndices = QList<int> { 0, 1, 2, 3 };
mappingData.push_back(mapping);
channelResults = QList<float> { 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<int>(QVariant::List);
+ mapping.type = static_cast<int>(QMetaType::QVariantList);
mapping.channelIndices = QList<int> { 0, 1, 2, 3, 4, 5, 6 };
mappingData.push_back(mapping);
channelResults = QList<float> { 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<int>(QVariant::Vector3D);
+ mapping.type = static_cast<int>(QMetaType::QVector3D);
mapping.channelIndices = QList<int> { 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<int>(QVariant::Double);
+ mapping.type = static_cast<int>(QMetaType::Double);
mapping.channelIndices = QList<int> { 0 };
mapping.callback = &callback;
mapping.callbackFlags = {};
@@ -1425,7 +1425,7 @@ private Q_SLOTS:
channel.channelComponents.resize(3);
// leave 'name' empty
- dataType = static_cast<int>(QVariant::Vector3D);
+ dataType = static_cast<int>(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<int>(QVariant::Vector3D);
+ dataType = static_cast<int>(QMetaType::QVector3D);
expectedChannelComponentCount = 3;
offset = 0;
suffixes = QList<char> { '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<int>(QVariant::Vector2D);
+ dataType = static_cast<int>(QMetaType::QVector2D);
expectedChannelComponentCount = 2;
offset = 0;
suffixes = QList<char> { '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<int>(QVariant::Vector4D);
+ dataType = static_cast<int>(QMetaType::QVector4D);
expectedChannelComponentCount = 4;
offset = 0;
suffixes = QList<char> { '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<int>(QVariant::Double);
+ dataType = static_cast<int>(QMetaType::Double);
expectedChannelComponentCount = 1;
offset = 0;
suffixes = QList<char> { '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<int>(QVariant::Quaternion);
+ dataType = static_cast<int>(QMetaType::QQuaternion);
expectedChannelComponentCount = 4;
offset = 0;
suffixes = QList<char> { '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<int>(QVariant::Quaternion);
+ dataType = static_cast<int>(QMetaType::QQuaternion);
expectedChannelComponentCount = 4;
offset = 0;
suffixes = QList<char> { '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<int>(QVariant::Color);
+ dataType = static_cast<int>(QMetaType::QColor);
expectedChannelComponentCount = 3;
offset = 0;
suffixes = QList<char> { '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<int>(QVariant::Color);
+ dataType = static_cast<int>(QMetaType::QColor);
expectedChannelComponentCount = 4;
offset = 0;
suffixes = QList<char> { 'R', 'G', 'B', 'A' };
@@ -1701,7 +1701,7 @@ private Q_SLOTS:
channel.channelComponents.resize(6);
// leave channel component names empty
- dataType = static_cast<int>(QVariant::List);
+ dataType = static_cast<int>(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<int>(QVariant::Quaternion);
+ dataType = static_cast<int>(QMetaType::QQuaternion);
componentCount = 4;
offset = 0;
expectedResults = QList<int> { 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<int>(QVariant::Vector3D);
+ dataType = static_cast<int>(QMetaType::QVector3D);
componentCount = 3;
offset = 0;
expectedResults = QList<int> { 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<int>(QVariant::Color);
+ dataType = static_cast<int>(QMetaType::QColor);
componentCount = 3;
offset = 0;
expectedResults = QList<int> { 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<int>(QVariant::Color);
+ dataType = static_cast<int>(QMetaType::QColor);
componentCount = 4;
offset = 0;
expectedResults = QList<int> { 0, 1, 2, 3 };
@@ -2648,14 +2648,14 @@ private Q_SLOTS:
QLatin1String("Location"),
Qt3DCore::QNodeId::createId(),
"translation",
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
auto channelMapper = createChannelMapper(handler,
QList<Qt3DCore::QNodeId> { channelMapping->peerId() });
const QList<ChannelNameAndType> expectedResults = {
{ QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
channelMapping->peerId() }
};
@@ -2669,13 +2669,13 @@ private Q_SLOTS:
QLatin1String("Location"),
Qt3DCore::QNodeId::createId(),
"translation",
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
auto channelMapping2 = createChannelMapping(handler,
QLatin1String("Rotation"),
Qt3DCore::QNodeId::createId(),
"rotation",
- static_cast<int>(QVariant::Quaternion),
+ static_cast<int>(QMetaType::QQuaternion),
4);
const QList<Qt3DCore::QNodeId> channelMappingIds
@@ -2684,11 +2684,11 @@ private Q_SLOTS:
const QList<ChannelNameAndType> expectedResults = {
{ QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
channelMapping1->peerId() },
{ QLatin1String("Rotation"),
- static_cast<int>(QVariant::Quaternion),
+ static_cast<int>(QMetaType::QQuaternion),
4,
channelMapping2->peerId() }
};
@@ -2702,25 +2702,25 @@ private Q_SLOTS:
QLatin1String("Location"),
Qt3DCore::QNodeId::createId(),
"translation",
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
auto channelMapping2 = createChannelMapping(handler,
QLatin1String("Rotation"),
Qt3DCore::QNodeId::createId(),
"rotation",
- static_cast<int>(QVariant::Quaternion),
+ static_cast<int>(QMetaType::QQuaternion),
4);
auto channelMapping3 = createChannelMapping(handler,
QLatin1String("Location"),
Qt3DCore::QNodeId::createId(),
"translation",
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
auto channelMapping4 = createChannelMapping(handler,
QLatin1String("Location"),
Qt3DCore::QNodeId::createId(),
"translation",
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
const QList<Qt3DCore::QNodeId> channelMappingIds
@@ -2730,19 +2730,19 @@ private Q_SLOTS:
QList<ChannelNameAndType> expectedResults = {
{ QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
channelMapping1->peerId() },
{ QLatin1String("Rotation"),
- static_cast<int>(QVariant::Quaternion),
+ static_cast<int>(QMetaType::QQuaternion),
4,
channelMapping2->peerId() },
{ QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
channelMapping3->peerId() },
{ QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
channelMapping4->peerId() }
};
@@ -2761,7 +2761,7 @@ private Q_SLOTS:
QList<ChannelNameAndType> expectedResults;
for (int i = 0; i < jointCount; ++i) {
ChannelNameAndType locationDescription = { QLatin1String("Location"),
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(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<int>(QVariant::Quaternion),
+ static_cast<int>(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<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3,
channelMapping->peerId() };
scaleDescription.jointIndex = i;
@@ -2815,7 +2815,7 @@ private Q_SLOTS:
{
const QList<ChannelNameAndType> allChannels = {
- { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 }
+ { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 }
};
const QList<ComponentIndices> expectedResults = { { 0, 1, 2 } };
@@ -2825,8 +2825,8 @@ private Q_SLOTS:
{
const QList<ChannelNameAndType> allChannels = {
- { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), 4 }
+ { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 }
};
const QList<ComponentIndices> expectedResults = { { 0, 1, 2 },
@@ -2837,12 +2837,12 @@ private Q_SLOTS:
{
const QList<ChannelNameAndType> allChannels = {
- { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), 4 },
- { QLatin1String("BaseColor"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Metalness"), static_cast<int>(QVariant::Double), 1 },
- { QLatin1String("Roughness"), static_cast<int>(QVariant::Double), 1 },
- { QLatin1String("MorphWeights"), static_cast<int>(QVariant::List), 6 }
+ { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
+ { QLatin1String("BaseColor"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Metalness"), static_cast<int>(QMetaType::Double), 1 },
+ { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 },
+ { QLatin1String("MorphWeights"), static_cast<int>(QMetaType::QVariantList), 6 }
};
const QList<ComponentIndices> expectedResults = {
@@ -2860,15 +2860,15 @@ private Q_SLOTS:
QList<ChannelNameAndType> allChannels;
const int jointCount = 4;
for (int i = 0; i < jointCount; ++i) {
- ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 };
+ ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 };
locationDescription.jointIndex = i;
allChannels.push_back(locationDescription);
- ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), 4 };
+ ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 };
rotationDescription.jointIndex = i;
allChannels.push_back(rotationDescription);
- ChannelNameAndType scaleDescription = { QLatin1String("Scale"), static_cast<int>(QVariant::Vector3D), 3 };
+ ChannelNameAndType scaleDescription = { QLatin1String("Scale"), static_cast<int>(QMetaType::QVector3D), 3 };
scaleDescription.jointIndex = i;
allChannels.push_back(scaleDescription);
}
@@ -2913,11 +2913,11 @@ private Q_SLOTS:
{
const QList<ChannelNameAndType> targetChannels = {
- { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), 4 },
- { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Base Color"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Metalness"), static_cast<int>(QVariant::Double), 1 },
- { QLatin1String("Roughness"), static_cast<int>(QVariant::Double), 1 }
+ { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
+ { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Base Color"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Metalness"), static_cast<int>(QMetaType::Double), 1 },
+ { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 }
};
const QList<ComponentIndices> targetIndices = {
@@ -2953,11 +2953,11 @@ private Q_SLOTS:
{
const QList<ChannelNameAndType> targetChannels = {
- { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), 4 },
- { QLatin1String("Base Color"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Metalness"), static_cast<int>(QVariant::Double), 1 },
- { QLatin1String("Roughness"), static_cast<int>(QVariant::Double), 1 }
+ { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
+ { QLatin1String("Base Color"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Metalness"), static_cast<int>(QMetaType::Double), 1 },
+ { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 }
};
const QList<ComponentIndices> targetIndices = {
@@ -2993,11 +2993,11 @@ private Q_SLOTS:
{
const QList<ChannelNameAndType> targetChannels = {
- { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), 4 },
- { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Albedo"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Metalness"), static_cast<int>(QVariant::Double), 1 },
- { QLatin1String("Roughness"), static_cast<int>(QVariant::Double), 1 }
+ { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
+ { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Albedo"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Metalness"), static_cast<int>(QMetaType::Double), 1 },
+ { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 }
};
const QList<ComponentIndices> targetIndices = {
@@ -3033,11 +3033,11 @@ private Q_SLOTS:
{
const QList<ChannelNameAndType> targetChannels = {
- { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), 4 },
- { QLatin1String("Albedo"), static_cast<int>(QVariant::Vector3D), 3 },
- { QLatin1String("Metalness"), static_cast<int>(QVariant::Double), 1 },
- { QLatin1String("Roughness"), static_cast<int>(QVariant::Double), 1 }
+ { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 },
+ { QLatin1String("Albedo"), static_cast<int>(QMetaType::QVector3D), 3 },
+ { QLatin1String("Metalness"), static_cast<int>(QMetaType::Double), 1 },
+ { QLatin1String("Roughness"), static_cast<int>(QMetaType::Double), 1 }
};
const QList<ComponentIndices> targetIndices = {
@@ -3075,15 +3075,15 @@ private Q_SLOTS:
QList<ChannelNameAndType> targetChannels;
const int jointCount = 4;
for (int i = 0; i < jointCount; ++i) {
- ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), 3 };
+ ChannelNameAndType locationDescription = { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), 3 };
locationDescription.jointIndex = i;
targetChannels.push_back(locationDescription);
- ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), 4 };
+ ChannelNameAndType rotationDescription = { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), 4 };
rotationDescription.jointIndex = i;
targetChannels.push_back(rotationDescription);
- ChannelNameAndType scaleDescription = { QLatin1String("Scale"), static_cast<int>(QVariant::Vector3D), 3 };
+ ChannelNameAndType scaleDescription = { QLatin1String("Scale"), static_cast<int>(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<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
ChannelNameAndType channelDescription;
channelDescription.mappingId = channelMapping->peerId();
- channelDescription.type = static_cast<int>(QVariant::Vector3D);
+ channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.name = QLatin1String("translation");
const QList<float> 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<int>(QVariant::Quaternion),
+ static_cast<int>(QMetaType::QQuaternion),
4);
ChannelNameAndType channelDescription;
channelDescription.mappingId = channelMapping->peerId();
- channelDescription.type = static_cast<int>(QVariant::Quaternion);
+ channelDescription.type = static_cast<int>(QMetaType::QQuaternion);
channelDescription.name = QLatin1String("rotation");
const QList<float> 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<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
ChannelNameAndType channelDescription;
channelDescription.mappingId = channelMapping->peerId();
- channelDescription.type = static_cast<int>(QVariant::Vector3D);
+ channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.name = QLatin1String("scale");
const QList<float> 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<int>(QVariant::Vector3D);
+ channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 0;
channelDescription.jointTransformComponent = Scale;
const QList<float> 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<int>(QVariant::Vector3D);
+ channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 0;
channelDescription.jointTransformComponent = Rotation;
const QList<float> 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<int>(QVariant::Vector3D);
+ channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 0;
channelDescription.jointTransformComponent = Translation;
const QList<float> 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<int>(QVariant::Vector3D);
+ channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 1;
channelDescription.jointTransformComponent = Scale;
const QList<float> 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<int>(QVariant::Vector3D);
+ channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 1;
channelDescription.jointTransformComponent = Rotation;
const QList<float> 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<int>(QVariant::Vector3D);
+ channelDescription.type = static_cast<int>(QMetaType::QVector3D);
channelDescription.jointIndex = 1;
channelDescription.jointTransformComponent = Translation;
const QList<float> 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<int>(QVariant::Vector2D));
+ QCOMPARE(backendMapping.type(), static_cast<int>(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<int>(QVariant::Invalid));
+ QCOMPARE(backendMapping.type(), static_cast<int>(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<int>(QVariant::Invalid));
+ QCOMPARE(backendMapping.type(), static_cast<int>(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<int>(QVariant::Vector3D));
+ QCOMPARE(backendMapping.type(), static_cast<int>(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<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
channelMapper = createChannelMapper(handler, QList<Qt3DCore::QNodeId> { channelMapping->peerId() });
animator->setMapperId(channelMapper->peerId());
@@ -181,7 +181,7 @@ private Q_SLOTS:
QLatin1String("Location"),
Qt3DCore::QNodeId::createId(),
"translation",
- static_cast<int>(QVariant::Vector3D),
+ static_cast<int>(QMetaType::QVector3D),
3);
channelMapper = createChannelMapper(handler, QList<Qt3DCore::QNodeId> { 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<const Qt3DAnimation::QChannelMappingPrivate *>(
Qt3DAnimation::QChannelMappingPrivate::get(&mapping));
- QCOMPARE(d->m_type, static_cast<int>(QVariant::Invalid));
+ QCOMPARE(d->m_type, static_cast<int>(QMetaType::UnknownType));
QCOMPARE(d->m_componentCount, 0);
}
@@ -237,13 +237,13 @@ private Q_SLOTS:
QTest::addColumn<int>("expectedComponentCount");
QTest::newRow("float") << QByteArrayLiteral("floatProperty") << QVariant(1.0f) << static_cast<int>(QMetaType::Float) << 1;
- QTest::newRow("vec2") << QByteArrayLiteral("vec2Property") << QVariant(QVector2D(1.0f, 1.0f)) << static_cast<int>(QVariant::Vector2D) << 2;
- QTest::newRow("vec3") << QByteArrayLiteral("vec3Property") << QVariant(QVector3D(1.0f, 1.0f, 1.0f)) << static_cast<int>(QVariant::Vector3D) << 3;
- QTest::newRow("vec4") << QByteArrayLiteral("vec4Property") << QVariant(QVector4D(1.0f, 1.0f, 1.0f, 1.0f)) << static_cast<int>(QVariant::Vector4D) << 4;
- QTest::newRow("quaternion") << QByteArrayLiteral("quaternionProperty") << QVariant(QQuaternion(1.0f, 1.0f, 1.0f, 1.0f)) << static_cast<int>(QVariant::Quaternion) << 4;
+ QTest::newRow("vec2") << QByteArrayLiteral("vec2Property") << QVariant(QVector2D(1.0f, 1.0f)) << static_cast<int>(QMetaType::QVector2D) << 2;
+ QTest::newRow("vec3") << QByteArrayLiteral("vec3Property") << QVariant(QVector3D(1.0f, 1.0f, 1.0f)) << static_cast<int>(QMetaType::QVector3D) << 3;
+ QTest::newRow("vec4") << QByteArrayLiteral("vec4Property") << QVariant(QVector4D(1.0f, 1.0f, 1.0f, 1.0f)) << static_cast<int>(QMetaType::QVector4D) << 4;
+ QTest::newRow("quaternion") << QByteArrayLiteral("quaternionProperty") << QVariant(QQuaternion(1.0f, 1.0f, 1.0f, 1.0f)) << static_cast<int>(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<int>(QVariant::List) << 5;
+ QTest::newRow("variantlist") << QByteArrayLiteral("listProperty") << QVariant::fromValue(list) << static_cast<int>(QMetaType::QVariantList) << 5;
QList<float> vec(8);
QTest::newRow("vector") << QByteArrayLiteral("vecProperty") << QVariant::fromValue(vec) << qMetaTypeId<decltype(vec)>() << 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<int>(QVariant::ByteArray));
+ QCOMPARE(data.userType(), static_cast<int>(QMetaType::QByteArray));
QVERIFY(data.value<QByteArray>().isEmpty());
}
@@ -80,7 +80,7 @@ private Q_SLOTS:
QVariant data = buf.readBinaryFile(path);
// THEN
- QCOMPARE(data.userType(), static_cast<int>(QVariant::ByteArray));
+ QCOMPARE(data.userType(), static_cast<int>(QMetaType::QByteArray));
const QByteArray byteArray = data.value<QByteArray>();
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<rowCount(parent))
+ if (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<Quick3DNodeInstantiator*>(rootObject->findChild<QObject*>("instantiator1"));
- QVERIFY(instantiator != 0);
+ QVERIFY(instantiator != nullptr);
model->drop(1);
const QList<QString> 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<HMatrix> &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<HCameraLens> &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<QColor>(), v2.value<QColor>());
- } else if (v1.type() == QVariant::Vector3D) {
+ } else if (v1.metaType().id() == QMetaType::QVector3D) {
QCOMPARE(v1.value<QVector3D>(), v2.value<QVector3D>());
- } else if (v1.type() == QVariant::Matrix4x4) {
+ } else if (v1.metaType().id() == QMetaType::QMatrix4x4) {
QCOMPARE(v1.value<QMatrix4x4>(), v2.value<QMatrix4x4>());
- } 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<Qt3DRender::QParameter *> &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<QColor>();
QVector4D vec = p2->value().value<QVector4D>();
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<Qt3DRender::RayCasting::QRay3D>();
- 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));
}