summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/animation/backend/animationclip.cpp4
-rw-r--r--src/animation/backend/animationutils.cpp39
-rw-r--r--src/animation/backend/buildblendtreesjob.cpp4
-rw-r--r--src/animation/backend/channelmapping.cpp4
-rw-r--r--src/animation/backend/clipblendnode.cpp2
-rw-r--r--src/animation/backend/clipblendnodevisitor.cpp8
-rw-r--r--src/animation/backend/evaluateblendclipanimatorjob.cpp2
-rw-r--r--src/animation/backend/gltfimporter.cpp14
-rw-r--r--src/animation/frontend/qcallbackmapping.cpp6
-rw-r--r--src/animation/frontend/qchannelmapping.cpp18
-rw-r--r--src/input/backend/loadproxydevicejob.cpp2
-rw-r--r--src/input/backend/updateaxisactionjob.cpp8
-rw-r--r--src/plugins/geometryloaders/default/objgeometryloader.cpp2
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp2
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h4
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp2
-rw-r--r--src/plugins/renderers/opengl/renderer/renderer.cpp10
-rw-r--r--src/plugins/renderers/rhi/renderer/pipelineuboset.cpp2
-rw-r--r--src/plugins/renderers/rhi/renderer/renderer.cpp8
-rw-r--r--src/plugins/renderers/rhi/renderer/rhishader.cpp19
-rw-r--r--src/plugins/sceneparsers/gltf/gltfimporter.cpp22
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.cpp12
-rw-r--r--src/render/backend/entity_p.h4
-rw-r--r--src/render/backend/visitorutils_p.h2
-rw-r--r--src/render/framegraph/framegraphvisitor.cpp2
-rw-r--r--src/render/geometry/gltfskeletonloader.cpp12
-rw-r--r--src/render/jobs/filtercompatibletechniquejob.cpp2
-rw-r--r--src/render/jobs/filterlayerentityjob.cpp10
-rw-r--r--src/render/jobs/filterproximitydistancejob.cpp2
-rw-r--r--src/render/jobs/pickboundingvolumeutils.cpp2
-rw-r--r--src/render/jobs/renderviewjobutils.cpp10
-rw-r--r--src/render/jobs/updateentitylayersjob.cpp2
-rw-r--r--src/render/materialsystem/filterkey.cpp2
-rw-r--r--src/render/materialsystem/qparameter.cpp2
-rw-r--r--src/render/materialsystem/shaderdata.cpp2
-rw-r--r--src/render/materialsystem/technique.cpp4
-rw-r--r--src/render/shadergraph/qshadergraphloader.cpp16
-rw-r--r--src/render/shadergraph/qshadernodesloader.cpp12
38 files changed, 131 insertions, 149 deletions
diff --git a/src/animation/backend/animationclip.cpp b/src/animation/backend/animationclip.cpp
index 9f18b5eed..699d4dc50 100644
--- a/src/animation/backend/animationclip.cpp
+++ b/src/animation/backend/animationclip.cpp
@@ -167,12 +167,12 @@ void AnimationClip::loadAnimation()
// that the clip has changed and that they are now dirty
{
QMutexLocker lock(&m_mutex);
- for (const Qt3DCore::QNodeId id : qAsConst(m_dependingAnimators)) {
+ for (const Qt3DCore::QNodeId &id : qAsConst(m_dependingAnimators)) {
ClipAnimator *animator = m_handler->clipAnimatorManager()->lookupResource(id);
if (animator)
animator->animationClipMarkedDirty();
}
- for (const Qt3DCore::QNodeId id : qAsConst(m_dependingBlendedAnimators)) {
+ for (const Qt3DCore::QNodeId &id : qAsConst(m_dependingBlendedAnimators)) {
BlendedClipAnimator *animator = m_handler->blendedClipAnimatorManager()->lookupResource(id);
if (animator)
animator->animationClipMarkedDirty();
diff --git a/src/animation/backend/animationutils.cpp b/src/animation/backend/animationutils.cpp
index b44b467de..e2cb04c15 100644
--- a/src/animation/backend/animationutils.cpp
+++ b/src/animation/backend/animationutils.cpp
@@ -163,10 +163,10 @@ ComponentIndices channelComponentsToIndices(const Channel &channel,
static const QList<char> colorSuffixesRGBA = { 'R', 'G', 'B', 'A' };
switch (dataType) {
- case QVariant::Quaternion:
+ case QMetaType::QQuaternion:
return channelComponentsToIndicesHelper(channel, expectedComponentCount,
offset, quaternionSuffixes);
- case QVariant::Color:
+ case QMetaType::QColor:
if (expectedComponentCount == 3)
return channelComponentsToIndicesHelper(channel, expectedComponentCount,
offset, colorSuffixesRGB);
@@ -184,7 +184,7 @@ ComponentIndices channelComponentsToIndicesHelper(const Channel &channel,
int offset,
const QList<char> &suffixes)
{
- const int actualComponentCount = channel.channelComponents.size();
+ const int actualComponentCount = int(channel.channelComponents.size());
if (actualComponentCount != expectedComponentCount) {
qWarning() << "Data type expects" << expectedComponentCount
<< "but found" << actualComponentCount << "components in the animation clip";
@@ -351,24 +351,24 @@ QVariant buildPropertyValue(const MappingData &mappingData, const QList<float> &
switch (mappingData.type) {
case QMetaType::Float:
- case QVariant::Double: {
+ case QMetaType::Double: {
return QVariant::fromValue(channelResults[mappingData.channelIndices[0]]);
}
- case QVariant::Vector2D: {
+ case QMetaType::QVector2D: {
const QVector2D vector(channelResults[mappingData.channelIndices[0]],
channelResults[mappingData.channelIndices[1]]);
return QVariant::fromValue(vector);
}
- case QVariant::Vector3D: {
+ case QMetaType::QVector3D: {
const QVector3D vector(channelResults[mappingData.channelIndices[0]],
channelResults[mappingData.channelIndices[1]],
channelResults[mappingData.channelIndices[2]]);
return QVariant::fromValue(vector);
}
- case QVariant::Vector4D: {
+ case QMetaType::QVector4D: {
const QVector4D vector(channelResults[mappingData.channelIndices[0]],
channelResults[mappingData.channelIndices[1]],
channelResults[mappingData.channelIndices[2]],
@@ -376,7 +376,7 @@ QVariant buildPropertyValue(const MappingData &mappingData, const QList<float> &
return QVariant::fromValue(vector);
}
- case QVariant::Quaternion: {
+ case QMetaType::QQuaternion: {
QQuaternion q(channelResults[mappingData.channelIndices[0]],
channelResults[mappingData.channelIndices[1]],
channelResults[mappingData.channelIndices[2]],
@@ -385,7 +385,7 @@ QVariant buildPropertyValue(const MappingData &mappingData, const QList<float> &
return QVariant::fromValue(q);
}
- case QVariant::Color: {
+ case QMetaType::QColor: {
// A color can either be a vec3 or a vec4
const QColor color =
QColor::fromRgbF(channelResults[mappingData.channelIndices[0]],
@@ -395,11 +395,12 @@ QVariant buildPropertyValue(const MappingData &mappingData, const QList<float> &
return QVariant::fromValue(color);
}
- case QVariant::List: {
+ case QMetaType::QVariantList: {
const QVariantList results = mapChannelResultsToContainer<QVariantList>(
mappingData, channelResults);
return QVariant::fromValue(results);
}
+
default:
qWarning() << "Unhandled animation type" << mappingData.type;
break;
@@ -528,7 +529,7 @@ QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMa
mappingData.callback = mapping->callback();
mappingData.callbackFlags = mapping->callbackFlags();
- if (mappingData.type == static_cast<int>(QVariant::Invalid)) {
+ if (mappingData.type == static_cast<int>(QMetaType::UnknownType)) {
qWarning() << "Unknown type for node id =" << mappingData.targetId
<< "and property =" << mapping->propertyName()
<< "and callback =" << mapping->callback();
@@ -558,9 +559,9 @@ QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMa
case ChannelMapping::SkeletonMappingType: {
const QList<ChannelNameAndType> jointProperties
- = { { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), Translation },
- { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), Rotation },
- { QLatin1String("Scale"), static_cast<int>(QVariant::Vector3D), Scale } };
+ = { { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), Translation },
+ { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), Rotation },
+ { QLatin1String("Scale"), static_cast<int>(QMetaType::QVector3D), Scale } };
const QHash<QString, const char *> channelNameToPropertyName
= { { QLatin1String("Location"), "translation" },
{ QLatin1String("Rotation"), "rotation" },
@@ -636,7 +637,7 @@ QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
// We could add them all then sort and remove duplicates. However, our approach has the
// advantage of keeping the blend tree format more consistent with the mapping
// orderings which will have better cache locality when generating events.
- for (const Qt3DCore::QNodeId mappingId : mappingIds) {
+ for (const Qt3DCore::QNodeId &mappingId : mappingIds) {
// Get the mapping object
ChannelMapping *mapping = mappingManager->lookupResource(mappingId);
Q_ASSERT(mapping);
@@ -661,9 +662,9 @@ QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
// Add an entry for each scale/rotation/translation property of each joint index
// of the target skeleton.
const QList<ChannelNameAndType> jointProperties
- = { { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), Translation },
- { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), Rotation },
- { QLatin1String("Scale"), static_cast<int>(QVariant::Vector3D), Scale } };
+ = { { QLatin1String("Location"), static_cast<int>(QMetaType::QVector3D), Translation },
+ { QLatin1String("Rotation"), static_cast<int>(QMetaType::QQuaternion), Rotation },
+ { QLatin1String("Scale"), static_cast<int>(QMetaType::QVector3D), Scale } };
Skeleton *skeleton = handler->skeletonManager()->lookupResource(mapping->skeletonId());
const int jointCount = skeleton->jointCount();
for (int jointIndex = 0; jointIndex < jointCount; ++jointIndex) {
@@ -732,7 +733,7 @@ QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
clipIds.append(blendNode->peerId());
const auto dependencyIds = blendNode->currentDependencyIds();
- for (const auto dependencyId : dependencyIds) {
+ for (const auto &dependencyId : dependencyIds) {
// Look up the blend node and if it's a value type (clip),
// add it to the set of value node ids that need to be evaluated
ClipBlendNode *node = nodeManager->lookupNode(dependencyId);
diff --git a/src/animation/backend/buildblendtreesjob.cpp b/src/animation/backend/buildblendtreesjob.cpp
index aeaaa8c11..a9a6ce36c 100644
--- a/src/animation/backend/buildblendtreesjob.cpp
+++ b/src/animation/backend/buildblendtreesjob.cpp
@@ -107,7 +107,7 @@ void BuildBlendTreesJob::run()
// a QList<QClipBlendValue*> as input.
QList<ClipBlendValue *> valueNodes;
valueNodes.reserve(valueNodeIds.size());
- for (const auto valueNodeId : valueNodeIds) {
+ for (const auto &valueNodeId : valueNodeIds) {
ClipBlendValue *valueNode
= static_cast<ClipBlendValue *>(m_handler->clipBlendNodeManager()->lookupNode(valueNodeId));
Q_ASSERT(valueNode);
@@ -184,7 +184,7 @@ void BuildBlendTreesJob::run()
const QList<Qt3DCore::QNodeId> channelMappingIds = mapper->mappingIds();
QList<ChannelMapping *> channelMappings;
channelMappings.reserve(channelMappingIds.size());
- for (const auto mappingId : channelMappingIds) {
+ for (const auto &mappingId : channelMappingIds) {
ChannelMapping *mapping = m_handler->channelMappingManager()->lookupResource(mappingId);
Q_ASSERT(mapping);
channelMappings.push_back(mapping);
diff --git a/src/animation/backend/channelmapping.cpp b/src/animation/backend/channelmapping.cpp
index cfc6a16ef..c76f2e239 100644
--- a/src/animation/backend/channelmapping.cpp
+++ b/src/animation/backend/channelmapping.cpp
@@ -54,7 +54,7 @@ ChannelMapping::ChannelMapping()
: BackendNode(ReadOnly)
, m_channelName()
, m_targetId()
- , m_type(static_cast<int>(QVariant::Invalid))
+ , m_type(static_cast<int>(QMetaType::UnknownType))
, m_componentCount(0)
, m_propertyName(nullptr)
, m_callback(nullptr)
@@ -68,7 +68,7 @@ void ChannelMapping::cleanup()
setEnabled(false);
m_channelName.clear();
m_targetId = Qt3DCore::QNodeId();
- m_type = static_cast<int>(QVariant::Invalid);
+ m_type = static_cast<int>(QMetaType::UnknownType);
m_propertyName = nullptr;
m_componentCount = 0;
m_callback = nullptr;
diff --git a/src/animation/backend/clipblendnode.cpp b/src/animation/backend/clipblendnode.cpp
index 37887664b..a44575064 100644
--- a/src/animation/backend/clipblendnode.cpp
+++ b/src/animation/backend/clipblendnode.cpp
@@ -134,7 +134,7 @@ void ClipBlendNode::blend(Qt3DCore::QNodeId animatorId)
const int dependencyCount = dependencyNodeIds.size();
QList<ClipResults> blendData;
blendData.reserve(dependencyCount);
- for (const auto dependencyId : dependencyNodeIds) {
+ for (const auto &dependencyId : dependencyNodeIds) {
ClipBlendNode *dependencyNode = clipBlendNodeManager()->lookupNode(dependencyId);
ClipResults blendDataElement = dependencyNode->clipResults(animatorId);
blendData.push_back(blendDataElement);
diff --git a/src/animation/backend/clipblendnodevisitor.cpp b/src/animation/backend/clipblendnodevisitor.cpp
index 5e63a4e79..0759dfa06 100644
--- a/src/animation/backend/clipblendnodevisitor.cpp
+++ b/src/animation/backend/clipblendnodevisitor.cpp
@@ -106,7 +106,7 @@ void ClipBlendNodeVisitor::visitPreOrderAllNodes(ClipBlendNode *node,
{
visitFunction(node);
const Qt3DCore::QNodeIdVector childIds = node->allDependencyIds();
- for (const Qt3DCore::QNodeId childId: childIds) {
+ for (const Qt3DCore::QNodeId &childId: childIds) {
ClipBlendNode *childNode = m_manager->lookupNode(childId);
if (childNode != nullptr)
visitPreOrderAllNodes(childNode, visitFunction);
@@ -122,7 +122,7 @@ void ClipBlendNodeVisitor::visitPostOrderAllNodes(ClipBlendNode *node,
const VisitFunction &visitFunction) const
{
const Qt3DCore::QNodeIdVector childIds = node->allDependencyIds();
- for (const Qt3DCore::QNodeId childId: childIds) {
+ for (const Qt3DCore::QNodeId &childId: childIds) {
ClipBlendNode *childNode = m_manager->lookupNode(childId);
if (childNode != nullptr)
visitPostOrderAllNodes(childNode, visitFunction);
@@ -140,7 +140,7 @@ void ClipBlendNodeVisitor::visitPreOrderDependencyNodes(ClipBlendNode *node,
{
visitFunction(node);
const Qt3DCore::QNodeIdVector childIds = node->currentDependencyIds();
- for (const Qt3DCore::QNodeId childId: childIds) {
+ for (const Qt3DCore::QNodeId &childId: childIds) {
ClipBlendNode *childNode = m_manager->lookupNode(childId);
if (childNode != nullptr)
visitPreOrderDependencyNodes(childNode, visitFunction);
@@ -156,7 +156,7 @@ void ClipBlendNodeVisitor::visitPostOrderDependencyNodes(ClipBlendNode *node,
const VisitFunction &visitFunction) const
{
const Qt3DCore::QNodeIdVector childIds = node->currentDependencyIds();
- for (const Qt3DCore::QNodeId childId: childIds) {
+ for (const Qt3DCore::QNodeId &childId: childIds) {
ClipBlendNode *childNode = m_manager->lookupNode(childId);
if (childNode != nullptr)
visitPostOrderDependencyNodes(childNode, visitFunction);
diff --git a/src/animation/backend/evaluateblendclipanimatorjob.cpp b/src/animation/backend/evaluateblendclipanimatorjob.cpp
index dad5be6ab..cfb2be1e0 100644
--- a/src/animation/backend/evaluateblendclipanimatorjob.cpp
+++ b/src/animation/backend/evaluateblendclipanimatorjob.cpp
@@ -103,7 +103,7 @@ void EvaluateBlendClipAnimatorJob::run()
// contained animation clips at the current phase and store the results
// in the animator indexed by node.
AnimationClipLoaderManager *clipLoaderManager = m_handler->animationClipLoaderManager();
- for (const auto valueNodeId : valueNodeIdsToEvaluate) {
+ for (const auto &valueNodeId : valueNodeIdsToEvaluate) {
ClipBlendValue *valueNode = static_cast<ClipBlendValue *>(blendNodeManager->lookupNode(valueNodeId));
Q_ASSERT(valueNode);
AnimationClip *clip = clipLoaderManager->lookupResource(valueNode->clipId());
diff --git a/src/animation/backend/gltfimporter.cpp b/src/animation/backend/gltfimporter.cpp
index 06ff6be67..910fd86fa 100644
--- a/src/animation/backend/gltfimporter.cpp
+++ b/src/animation/backend/gltfimporter.cpp
@@ -97,7 +97,7 @@ void jsonArrayToSqt(const QJsonArray &jsonArray, Qt3DCore::Sqt &sqt)
QMatrix4x4 m;
float *data = m.data();
int i = 0;
- for (const auto &element : jsonArray)
+ for (const auto element : jsonArray)
*(data + i++) = static_cast<float>(element.toDouble());
decomposeQMatrix4x4(m, sqt);
@@ -689,27 +689,27 @@ bool GLTFImporter::parseGLTF2()
{
bool success = true;
const QJsonArray buffers = m_json.object().value(KEY_BUFFERS).toArray();
- for (const auto &bufferValue : buffers)
+ for (const auto bufferValue : buffers)
success &= processJSONBuffer(bufferValue.toObject());
const QJsonArray bufferViews = m_json.object().value(KEY_BUFFER_VIEWS).toArray();
- for (const auto &bufferViewValue : bufferViews)
+ for (const auto bufferViewValue : bufferViews)
success &= processJSONBufferView(bufferViewValue.toObject());
const QJsonArray accessors = m_json.object().value(KEY_ACCESSORS).toArray();
- for (const auto &accessorValue : accessors)
+ for (const auto accessorValue : accessors)
success &= processJSONAccessor(accessorValue.toObject());
const QJsonArray skins = m_json.object().value(KEY_SKINS).toArray();
- for (const auto &skinValue : skins)
+ for (const auto skinValue : skins)
success &= processJSONSkin(skinValue.toObject());
const QJsonArray animations = m_json.object().value(KEY_ANIMATIONS).toArray();
- for (const auto &animationValue : animations)
+ for (const auto animationValue : animations)
success &= processJSONAnimation(animationValue.toObject());
const QJsonArray nodes = m_json.object().value(KEY_NODES).toArray();
- for (const auto &nodeValue : nodes)
+ for (const auto nodeValue : nodes)
success &= processJSONNode(nodeValue.toObject());
setupNodeParentLinks();
diff --git a/src/animation/frontend/qcallbackmapping.cpp b/src/animation/frontend/qcallbackmapping.cpp
index dcc352b17..435155e6b 100644
--- a/src/animation/frontend/qcallbackmapping.cpp
+++ b/src/animation/frontend/qcallbackmapping.cpp
@@ -47,7 +47,7 @@ namespace Qt3DAnimation {
QCallbackMappingPrivate::QCallbackMappingPrivate()
: QAbstractChannelMappingPrivate()
, m_channelName()
- , m_type(static_cast<int>(QVariant::Invalid))
+ , m_type(static_cast<int>(QMetaType::UnknownType))
, m_callback(nullptr)
{
m_mappingType = QAbstractChannelMappingPrivate::CallbackMapping;
@@ -107,8 +107,8 @@ void QCallbackMapping::setChannelName(const QString &channelName)
on the gui/main thread, or directly on one of the thread pool's worker
thread. This is controlled by \a flags.
- \a type specifies the type (for example, QVariant::Vector3D,
- QVariant::Color, or QMetaType::Float) of the animated value. When animating
+ \a type specifies the type (for example, QMetaType::QVector3D,
+ QMetaType::QColor, or QMetaType::Float) of the animated value. When animating
node properties this does not need to be provided separately, however it
becomes important to supply this when there is only a callback.
diff --git a/src/animation/frontend/qchannelmapping.cpp b/src/animation/frontend/qchannelmapping.cpp
index 9c6687031..f707dadb3 100644
--- a/src/animation/frontend/qchannelmapping.cpp
+++ b/src/animation/frontend/qchannelmapping.cpp
@@ -74,21 +74,21 @@ int componentCountForType(int type, const QVariant &value)
switch (type) {
case QMetaType::Float:
- case QVariant::Double:
+ case QMetaType::Double:
return 1;
- case QVariant::Vector2D:
+ case QMetaType::QVector2D:
return 2;
- case QVariant::Vector3D:
- case QVariant::Color:
+ case QMetaType::QVector3D:
+ case QMetaType::QColor:
return 3;
- case QVariant::Vector4D:
- case QVariant::Quaternion:
+ case QMetaType::QVector4D:
+ case QMetaType::QQuaternion:
return 4;
- case QVariant::List:
+ case QMetaType::QVariantList:
return componentCountForValue<QVariantList>(value.toList());
default:
@@ -105,7 +105,7 @@ QChannelMappingPrivate::QChannelMappingPrivate()
, m_target(nullptr)
, m_property()
, m_propertyName(nullptr)
- , m_type(static_cast<int>(QVariant::Invalid))
+ , m_type(static_cast<int>(QMetaType::UnknownType))
, m_componentCount(0)
{
m_mappingType = ChannelMapping;
@@ -123,7 +123,7 @@ void QChannelMappingPrivate::updatePropertyNameTypeAndComponentCount()
const char *propertyName = nullptr;
if (!m_target || m_property.isNull()) {
- type = QVariant::Invalid;
+ type = QMetaType::UnknownType;
} else {
const QMetaObject *mo = m_target->metaObject();
const int propertyIndex = mo->indexOfProperty(m_property.toLocal8Bit());
diff --git a/src/input/backend/loadproxydevicejob.cpp b/src/input/backend/loadproxydevicejob.cpp
index 5219a5546..3f9d3c211 100644
--- a/src/input/backend/loadproxydevicejob.cpp
+++ b/src/input/backend/loadproxydevicejob.cpp
@@ -98,7 +98,7 @@ void LoadProxyDeviceJob::run()
d->updates.reserve(m_proxies.size());
Q_ASSERT(m_inputHandler);
- for (const Qt3DCore::QNodeId id : qAsConst(m_proxies)) {
+ for (const Qt3DCore::QNodeId &id : qAsConst(m_proxies)) {
PhysicalDeviceProxy *proxy = m_inputHandler->physicalDeviceProxyManager()->lookupResource(id);
QAbstractPhysicalDevice *device = m_inputHandler->createPhysicalDevice(proxy->deviceName());
if (device != nullptr)
diff --git a/src/input/backend/updateaxisactionjob.cpp b/src/input/backend/updateaxisactionjob.cpp
index b230f6865..305d5031b 100644
--- a/src/input/backend/updateaxisactionjob.cpp
+++ b/src/input/backend/updateaxisactionjob.cpp
@@ -93,12 +93,12 @@ void UpdateAxisActionJob::updateAction(LogicalDevice *device)
const auto actionIds = device->actions();
d->m_triggeredActions.reserve(actionIds.size());
- for (const Qt3DCore::QNodeId actionId : actionIds) {
+ for (const Qt3DCore::QNodeId &actionId : actionIds) {
bool actionTriggered = false;
Action *action = m_handler->actionManager()->lookupResource(actionId);
const auto actionInputIds = action->inputs();
- for (const Qt3DCore::QNodeId actionInputId : actionInputIds)
+ for (const Qt3DCore::QNodeId &actionInputId : actionInputIds)
actionTriggered |= processActionInput(actionInputId);
if (action->isEnabled() && (action->actionTriggered() != actionTriggered)) {
@@ -121,12 +121,12 @@ void UpdateAxisActionJob::updateAxis(LogicalDevice *device)
const auto axisIds = device->axes();
d->m_triggeredAxis.reserve(axisIds.size());
- for (const Qt3DCore::QNodeId axisId : axisIds) {
+ for (const Qt3DCore::QNodeId &axisId : axisIds) {
Axis *axis = m_handler->axisManager()->lookupResource(axisId);
float axisValue = 0.0f;
const auto axisInputIds = axis->inputs();
- for (const Qt3DCore::QNodeId axisInputId : axisInputIds)
+ for (const Qt3DCore::QNodeId &axisInputId : axisInputIds)
axisValue += processAxisInput(axisInputId);
// Clamp the axisValue -1/1
diff --git a/src/plugins/geometryloaders/default/objgeometryloader.cpp b/src/plugins/geometryloaders/default/objgeometryloader.cpp
index 0d4c22ec3..2bc35f06a 100644
--- a/src/plugins/geometryloaders/default/objgeometryloader.cpp
+++ b/src/plugins/geometryloaders/default/objgeometryloader.cpp
@@ -238,7 +238,7 @@ bool ObjGeometryLoader::doLoad(QIODevice *ioDev, const QString &subMesh)
const int indexCount = faceIndexVector.size();
m_indices.clear();
m_indices.reserve(indexCount);
- for (const FaceIndices faceIndices : qAsConst(faceIndexVector)) {
+ for (const FaceIndices &faceIndices : qAsConst(faceIndexVector)) {
const unsigned int i = faceIndexMap.value(faceIndices);
m_indices.append(i);
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
index c9763fb0e..56af99d6a 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
@@ -321,7 +321,7 @@ void GraphicsContext::loadShader(Shader *shaderNode,
}
} else {
// Find an already loaded shader that shares the same QOpenGLShaderProgram
- for (const Qt3DCore::QNodeId sharedShaderId : sharedShaderIds) {
+ for (const Qt3DCore::QNodeId &sharedShaderId : sharedShaderIds) {
if (sharedShaderId != shaderNode->peerId()) {
Shader *refShader = shaderManager->lookupResource(sharedShaderId);
// We only introspect once per actual OpenGL shader program
diff --git a/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h b/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h
index a2a995811..f059012da 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h
@@ -96,7 +96,7 @@ public:
static QVarLengthArray<char, 64> array(16 * byteSize);
memset(array.data(), 0, array.size());
- switch (static_cast<QMetaType::Type>(v.type())) {
+ switch (v.metaType().id()) {
// 1 byte
case QMetaType::Bool: {
@@ -332,7 +332,7 @@ public:
}
}
else
- qWarning() << Q_FUNC_INFO << "QVariant type conversion not handled for " << v.type();
+ qWarning() << Q_FUNC_INFO << "QVariant type conversion not handled for " << v.metaType().id();
break;
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
index 72368ae1e..2df7b7736 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
@@ -1292,7 +1292,7 @@ bool SubmissionContext::setParameters(ShaderParameterPack &parameterPack, GLShad
// Bind Shader Storage block to SSBO and update SSBO
const std::vector<BlockToSSBO> &blockToSSBOs = parameterPack.shaderStorageBuffers();
- for (const BlockToSSBO b : blockToSSBOs) {
+ for (const BlockToSSBO &b : blockToSSBOs) {
Buffer *cpuBuffer = m_renderer->nodeManagers()->bufferManager()->lookupResource(b.m_bufferID);
GLBuffer *ssbo = glBufferForRenderBuffer(cpuBuffer);
// bindShaderStorageBlock
diff --git a/src/plugins/renderers/opengl/renderer/renderer.cpp b/src/plugins/renderers/opengl/renderer/renderer.cpp
index 2ba38caeb..26b2b0ed8 100644
--- a/src/plugins/renderers/opengl/renderer/renderer.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderer.cpp
@@ -1002,7 +1002,7 @@ void Renderer::lookForDirtyTextures()
const QNodeIdVector imageIds = texture->textureImageIds();
// Does the texture reference any of the dirty texture images?
- for (const QNodeId imageId: imageIds) {
+ for (const QNodeId &imageId: imageIds) {
if (dirtyImageIds.contains(imageId)) {
texture->addDirtyFlag(Texture::DirtyImageGenerators);
break;
@@ -1354,7 +1354,7 @@ void Renderer::updateTexture(Texture *texture)
std::vector<GLTexture::Image> images;
images.reserve(textureImageIds.size());
// TODO: Move this into GLTexture directly
- for (const QNodeId textureImageId : textureImageIds) {
+ for (const QNodeId &textureImageId : textureImageIds) {
const TextureImage *img = m_nodesManager->textureImageManager()->lookupResource(textureImageId);
if (img == nullptr) {
qWarning() << Q_FUNC_INFO << "invalid TextureImage handle";
@@ -1502,7 +1502,7 @@ Renderer::ViewSubmissionResultData Renderer::submitRenderViews(const std::vector
// Insert Fence into command stream if needed
const Qt3DCore::QNodeIdVector insertFenceIds = renderView->insertFenceIds();
GLFenceManager *fenceManager = m_glResourceManagers->glFenceManager();
- for (const Qt3DCore::QNodeId insertFenceId : insertFenceIds) {
+ for (const Qt3DCore::QNodeId &insertFenceId : insertFenceIds) {
// If the fence is not in the manager, then it hasn't been inserted
// into the command stream yet.
if (fenceManager->find(insertFenceId) == fenceManager->end()) {
@@ -2218,7 +2218,7 @@ void Renderer::cleanGraphicsResources()
// When Textures are cleaned up, their id is saved so that they can be
// cleaned up in the render thread
const QList<Qt3DCore::QNodeId> cleanedUpTextureIds = std::move(m_textureIdsToCleanup);
- for (const Qt3DCore::QNodeId textureCleanedUpId: cleanedUpTextureIds)
+ for (const Qt3DCore::QNodeId &textureCleanedUpId: cleanedUpTextureIds)
cleanupTexture(textureCleanedUpId);
// Delete abandoned VAOs
@@ -2240,7 +2240,7 @@ void Renderer::cleanGraphicsResources()
// that when this gets executed, all scene changes have been received and
// shader nodes updated
const QList<Qt3DCore::QNodeId> cleanedUpShaderIds = m_nodesManager->shaderManager()->takeShaderIdsToCleanup();
- for (const Qt3DCore::QNodeId shaderCleanedUpId: cleanedUpShaderIds) {
+ for (const Qt3DCore::QNodeId &shaderCleanedUpId: cleanedUpShaderIds) {
cleanupShader(m_nodesManager->shaderManager()->lookupResource(shaderCleanedUpId));
// We can really release the texture at this point
m_nodesManager->shaderManager()->releaseResource(shaderCleanedUpId);
diff --git a/src/plugins/renderers/rhi/renderer/pipelineuboset.cpp b/src/plugins/renderers/rhi/renderer/pipelineuboset.cpp
index 786a7e3ee..0031d927d 100644
--- a/src/plugins/renderers/rhi/renderer/pipelineuboset.cpp
+++ b/src/plugins/renderers/rhi/renderer/pipelineuboset.cpp
@@ -391,6 +391,7 @@ void PipelineUBOSet::uploadUBOs(SubmissionContext *ctx, RenderView *rv)
}
namespace {
+/*
void printUpload(const UniformValue &value, const QShaderDescription::BlockVariable &member, int arrayOffset)
{
switch (member.type) {
@@ -423,6 +424,7 @@ void printUpload(const UniformValue &value, const QShaderDescription::BlockVaria
break;
}
}
+//*/
inline void uploadDataToUBO(const QByteArray rawData,
const PipelineUBOSet::MultiUBOBufferWithBindingAndBlockSize *ubo,
diff --git a/src/plugins/renderers/rhi/renderer/renderer.cpp b/src/plugins/renderers/rhi/renderer/renderer.cpp
index aa18f093e..46a0107e1 100644
--- a/src/plugins/renderers/rhi/renderer/renderer.cpp
+++ b/src/plugins/renderers/rhi/renderer/renderer.cpp
@@ -1969,7 +1969,7 @@ void Renderer::updateTexture(Texture *texture)
std::vector<RHITexture::Image> images;
images.reserve(textureImageIds.size());
// TODO: Move this into RHITexture directly
- for (const QNodeId textureImageId : textureImageIds) {
+ for (const QNodeId &textureImageId : textureImageIds) {
const TextureImage *img =
m_nodesManager->textureImageManager()->lookupResource(textureImageId);
if (img == nullptr) {
@@ -2963,7 +2963,7 @@ void Renderer::cleanGraphicsResources()
// When Textures are cleaned up, their id is saved so that they can be
// cleaned up in the render thread
const QList<Qt3DCore::QNodeId> cleanedUpTextureIds = std::move(m_textureIdsToCleanup);
- for (const Qt3DCore::QNodeId textureCleanedUpId : cleanedUpTextureIds)
+ for (const Qt3DCore::QNodeId &textureCleanedUpId : cleanedUpTextureIds)
cleanupTexture(textureCleanedUpId);
// Abandon GL shaders when a Shader node is destroyed Note: We are sure
@@ -2971,7 +2971,7 @@ void Renderer::cleanGraphicsResources()
// shader nodes updated
const QList<Qt3DCore::QNodeId> cleanedUpShaderIds =
m_nodesManager->shaderManager()->takeShaderIdsToCleanup();
- for (const Qt3DCore::QNodeId shaderCleanedUpId : cleanedUpShaderIds) {
+ for (const Qt3DCore::QNodeId &shaderCleanedUpId : cleanedUpShaderIds) {
cleanupShader(m_nodesManager->shaderManager()->lookupResource(shaderCleanedUpId));
// We can really release the texture at this point
m_nodesManager->shaderManager()->releaseResource(shaderCleanedUpId);
@@ -2983,7 +2983,7 @@ void Renderer::cleanGraphicsResources()
const QList<Qt3DCore::QNodeId> cleanedUpRenderTargetIds =
m_nodesManager->renderTargetManager()->takeRenderTargetIdsToCleanup();
- for (const Qt3DCore::QNodeId renderTargetCleanedUpId : cleanedUpRenderTargetIds) {
+ for (const Qt3DCore::QNodeId &renderTargetCleanedUpId : cleanedUpRenderTargetIds) {
cleanupRenderTarget(renderTargetCleanedUpId);
m_nodesManager->renderTargetManager()->releaseResource(renderTargetCleanedUpId);
// Release pipelines that were referencing renderTarget
diff --git a/src/plugins/renderers/rhi/renderer/rhishader.cpp b/src/plugins/renderers/rhi/renderer/rhishader.cpp
index 466b1d7aa..7ac40b2b0 100644
--- a/src/plugins/renderers/rhi/renderer/rhishader.cpp
+++ b/src/plugins/renderers/rhi/renderer/rhishader.cpp
@@ -94,25 +94,6 @@ const std::vector<QByteArray> &RHIShader::shaderCode() const
}
namespace {
-static constexpr QRhiVertexInputAttribute::Format
-rhiInputType(QShaderDescription::VariableType type)
-{
- switch (type) {
- case QShaderDescription::Vec4:
- return QRhiVertexInputAttribute::Float4;
- case QShaderDescription::Vec3:
- return QRhiVertexInputAttribute::Float3;
- case QShaderDescription::Vec2:
- return QRhiVertexInputAttribute::Float2;
- case QShaderDescription::Float:
- return QRhiVertexInputAttribute::Float;
- default:
- // TODO UNormByte4, UNormByte2, UNormByte
- RHI_UNIMPLEMENTED;
- return QRhiVertexInputAttribute::UNormByte;
- break;
- }
-}
static constexpr int rhiTypeSize(QShaderDescription::VariableType type)
{
diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.cpp b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
index a03afec59..6cf84f89e 100644
--- a/src/plugins/sceneparsers/gltf/gltfimporter.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
@@ -495,7 +495,7 @@ Qt3DCore::QEntity* GLTFImporter::node(const QString &id)
}
} else {
const auto meshes = meshesValue.toArray();
- for (const QJsonValue &mesh : meshes) {
+ for (const QJsonValue mesh : meshes) {
const QString meshName = mesh.toString();
const auto geometryRenderers = qAsConst(m_meshDict).equal_range(meshName);
if (Q_UNLIKELY(geometryRenderers.first == geometryRenderers.second)) {
@@ -556,7 +556,7 @@ Qt3DCore::QEntity* GLTFImporter::node(const QString &id)
// recursively retrieve children
const auto children = jsonObj.value(KEY_CHILDREN).toArray();
- for (const QJsonValue &c : children) {
+ for (const QJsonValue c : children) {
QEntity* child = node((m_majorVersion > 1) ? QString::number(c.toInt()) : c.toString());
if (!child)
continue;
@@ -660,7 +660,7 @@ Qt3DCore::QEntity* GLTFImporter::scene(const QString &id)
const QJsonObject sceneObj = sceneVal.toObject();
sceneEntity = new QEntity;
const auto nodes = sceneObj.value(KEY_NODES).toArray();
- for (const QJsonValue &n : nodes) {
+ for (const QJsonValue n : nodes) {
QEntity* child = node(QString::number(n.toInt()));
if (!child)
continue;
@@ -679,7 +679,7 @@ Qt3DCore::QEntity* GLTFImporter::scene(const QString &id)
const QJsonObject sceneObj = sceneVal.toObject();
sceneEntity = new QEntity;
const auto nodes = sceneObj.value(KEY_NODES).toArray();
- for (const QJsonValue &nnv : nodes) {
+ for (const QJsonValue nnv : nodes) {
QString nodeName = nnv.toString();
QEntity* child = node(nodeName);
if (!child)
@@ -1680,7 +1680,7 @@ void GLTFImporter::processJSONTechnique(const QString &id, const QJsonObject &js
t->graphicsApiFilter()->setVendor(gabifilter.value(KEY_VENDOR).toString());
QStringList extensionList;
QJsonArray extArray = gabifilter.value(KEY_EXTENSIONS).toArray();
- for (const QJsonValue &extValue : extArray)
+ for (const QJsonValue extValue : extArray)
extensionList << extValue.toString();
t->graphicsApiFilter()->setExtensions(extensionList);
@@ -1698,7 +1698,7 @@ void GLTFImporter::processJSONTechnique(const QString &id, const QJsonObject &js
// Render passes
const QJsonArray passArray = jsonObject.value(KEY_RENDERPASSES).toArray();
- for (const QJsonValue &passValue : passArray) {
+ for (const QJsonValue passValue : passArray) {
const QString passName = passValue.toString();
QRenderPass *pass = m_renderPasses.value(passName);
if (pass) {
@@ -1725,7 +1725,7 @@ void GLTFImporter::processJSONMesh(const QString &id, const QJsonObject &json)
if (meshType.isEmpty()) {
// Custom mesh
const QJsonArray primitivesArray = json.value(KEY_PRIMITIVES).toArray();
- for (const QJsonValue &primitiveValue : primitivesArray) {
+ for (const QJsonValue primitiveValue : primitivesArray) {
const QJsonObject primitiveObject = primitiveValue.toObject();
const QJsonValue type = primitiveObject.value(KEY_MODE);
const QJsonValue matValue = primitiveObject.value(KEY_MATERIAL);
@@ -1855,8 +1855,8 @@ void GLTFImporter::processJSONMesh(const QString &id, const QJsonObject &json)
target->setProperty(propName.constData(), QVariant(size));
}
} else {
- const QVariant::Type propType = target->property(propName.constData()).type();
- if (propType == QVariant::Int) {
+ const QMetaType propType = target->property(propName.constData()).metaType();
+ if (propType.id() == QMetaType::Int) {
target->setProperty(propName.constData(), QVariant(it.value().toInt()));
} else {
target->setProperty(propName.constData(),
@@ -2017,7 +2017,7 @@ void GLTFImporter::processJSONEffect(const QString &id, const QJsonObject &jsonO
effect->addParameter(buildParameter(it.key(), it.value().toObject()));
const QJsonArray techArray = jsonObject.value(KEY_TECHNIQUES).toArray();
- for (const QJsonValue &techValue : techArray) {
+ for (const QJsonValue techValue : techArray) {
const QString techName = techValue.toString();
QTechnique *tech = m_techniques.value(techName);
if (tech) {
@@ -2513,7 +2513,7 @@ void GLTFImporter::populateRenderStates(QRenderPass *pass, const QJsonObject &st
// Process states to enable
const QJsonArray enableStatesArray = states.value(KEY_ENABLE).toArray();
QList<int> enableStates;
- for (const QJsonValue &enableValue : enableStatesArray)
+ for (const QJsonValue enableValue : enableStatesArray)
enableStates.append(enableValue.toInt());
// Process the list of state functions
diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
index a8eb10116..664ac39ae 100644
--- a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
+++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
@@ -662,7 +662,7 @@ void GLTFExporter::parseMaterials()
if (material->effect()) {
QList<QParameter *> parameters = material->effect()->parameters();
for (auto param : parameters) {
- if (param->value().type() == QVariant::Color) {
+ if (param->value().metaType().id() == QMetaType::QColor) {
QColor color = param->value().value<QColor>();
if (param->name() == MATERIAL_AMBIENT_COLOR) {
matInfo.colors.insert(QStringLiteral("ambient"), color);
@@ -956,8 +956,8 @@ void GLTFExporter::parseMeshes()
qUtf16PrintableImpl(meshInfo.name), qUtf16PrintableImpl(meshInfo.originalName));
qCDebug(GLTFExporterLog, " Vertex count: %i", vertexCount);
qCDebug(GLTFExporterLog, " Bytes per vertex: %i", stride);
- qCDebug(GLTFExporterLog, " Vertex buffer size (bytes): %i", vertexBuf.size());
- qCDebug(GLTFExporterLog, " Index buffer size (bytes): %i", indexBuf.size());
+ qCDebug(GLTFExporterLog, " Vertex buffer size (bytes): %lli", vertexBuf.size());
+ qCDebug(GLTFExporterLog, " Index buffer size (bytes): %lli", indexBuf.size());
QStringList sl;
const auto views = meshInfo.views;
for (const auto &bv : views)
@@ -976,7 +976,7 @@ void GLTFExporter::parseMeshes()
m_meshInfo.insert(mesh, meshInfo);
}
- qCDebug(GLTFExporterLog, "Total buffer size: %i", m_buffer.size());
+ qCDebug(GLTFExporterLog, "Total buffer size: %lli", m_buffer.size());
}
void GLTFExporter::parseCameras()
@@ -1799,7 +1799,7 @@ void GLTFExporter::exportParameter(QJsonObject &jsonObj, const QString &name,
paramObj[typeStr] = GL_SAMPLER_2D;
paramObj[valueStr] = m_textureIdMap.value(textureVariantToUrl(variant));
} else {
- switch (QMetaType::Type(variant.type())) {
+ switch (variant.metaType().id()) {
case QMetaType::Bool:
paramObj[typeStr] = GL_BOOL;
paramObj[valueStr] = variant.toBool();
@@ -2071,7 +2071,7 @@ QString GLTFExporter::textureVariantToUrl(const QVariant &var)
void GLTFExporter::setVarToJSonObject(QJsonObject &jsObj, const QString &key, const QVariant &var)
{
- switch (QMetaType::Type(var.type())) {
+ switch (var.metaType().id()) {
case QMetaType::Bool:
jsObj[key] = var.toBool();
break;
diff --git a/src/render/backend/entity_p.h b/src/render/backend/entity_p.h
index 3c2f9c2b5..e83765a78 100644
--- a/src/render/backend/entity_p.h
+++ b/src/render/backend/entity_p.h
@@ -269,7 +269,7 @@ private:
Manager *manager = m_nodeManagers->manager<Type, Manager>(); \
QList<Handle> entries; \
entries.reserve(variable.size()); \
- for (const QNodeId id : variable) \
+ for (const QNodeId &id : variable) \
entries.push_back(manager->lookupHandle(id)); \
return entries; \
} \
@@ -280,7 +280,7 @@ private:
Manager *manager = m_nodeManagers->manager<Type, Manager>(); \
std::vector<Type *> entries; \
entries.reserve(variable.size()); \
- for (const QNodeId id : variable) \
+ for (const QNodeId &id : variable) \
entries.push_back(manager->lookupResource(id)); \
return entries; \
} \
diff --git a/src/render/backend/visitorutils_p.h b/src/render/backend/visitorutils_p.h
index 824cd0ddf..cea4af2b1 100644
--- a/src/render/backend/visitorutils_p.h
+++ b/src/render/backend/visitorutils_p.h
@@ -132,7 +132,7 @@ void visitPrimitives(NodeManagers *manager, const GeometryProvider *renderer, Vi
if (geom) {
Qt3DRender::Render::Attribute *attribute = nullptr;
const auto attrIds = geom->attributes();
- for (const Qt3DCore::QNodeId attrId : attrIds) {
+ for (const Qt3DCore::QNodeId &attrId : attrIds) {
attribute = manager->lookupResource<Attribute, AttributeManager>(attrId);
if (attribute){
if (!positionAttribute && attribute->name() == Qt3DCore::QAttribute::defaultPositionAttributeName())
diff --git a/src/render/framegraph/framegraphvisitor.cpp b/src/render/framegraph/framegraphvisitor.cpp
index a5a47d711..7da61386a 100644
--- a/src/render/framegraph/framegraphvisitor.cpp
+++ b/src/render/framegraph/framegraphvisitor.cpp
@@ -96,7 +96,7 @@ void FrameGraphVisitor::visit(Render::FrameGraphNode *node)
// initiate a rendering from the current camera
const QList<Qt3DCore::QNodeId> fgChildIds = node->childrenIds();
- for (const Qt3DCore::QNodeId fgChildId : fgChildIds)
+ for (const Qt3DCore::QNodeId &fgChildId : fgChildIds)
visit(m_manager->lookupNode(fgChildId));
// Leaf node - create a RenderView ready to be populated
diff --git a/src/render/geometry/gltfskeletonloader.cpp b/src/render/geometry/gltfskeletonloader.cpp
index 3bd96e379..9bd59f54b 100644
--- a/src/render/geometry/gltfskeletonloader.cpp
+++ b/src/render/geometry/gltfskeletonloader.cpp
@@ -62,7 +62,7 @@ void jsonArrayToSqt(const QJsonArray &jsonArray, Qt3DCore::Sqt &sqt)
QMatrix4x4 m;
float *data = m.data();
int i = 0;
- for (const auto &element : jsonArray)
+ for (const auto element : jsonArray)
*(data + i++) = static_cast<float>(element.toDouble());
decomposeQMatrix4x4(m, sqt);
@@ -449,23 +449,23 @@ bool GLTFSkeletonLoader::parseGLTF2()
{
bool success = true;
const QJsonArray buffers = m_json.object().value(KEY_BUFFERS).toArray();
- for (const auto &bufferValue : buffers)
+ for (const auto bufferValue : buffers)
success &= processJSONBuffer(bufferValue.toObject());
const QJsonArray bufferViews = m_json.object().value(KEY_BUFFER_VIEWS).toArray();
- for (const auto &bufferViewValue : bufferViews)
+ for (const auto bufferViewValue : bufferViews)
success &= processJSONBufferView(bufferViewValue.toObject());
const QJsonArray accessors = m_json.object().value(KEY_ACCESSORS).toArray();
- for (const auto &accessorValue : accessors)
+ for (const auto accessorValue : accessors)
success &= processJSONAccessor(accessorValue.toObject());
const QJsonArray skins = m_json.object().value(KEY_SKINS).toArray();
- for (const auto &skinValue : skins)
+ for (const auto skinValue : skins)
success &= processJSONSkin(skinValue.toObject());
const QJsonArray nodes = m_json.object().value(KEY_NODES).toArray();
- for (const auto &nodeValue : nodes)
+ for (const auto nodeValue : nodes)
success &= processJSONNode(nodeValue.toObject());
setupNodeParentLinks();
diff --git a/src/render/jobs/filtercompatibletechniquejob.cpp b/src/render/jobs/filtercompatibletechniquejob.cpp
index e2c22401c..c53f811f8 100644
--- a/src/render/jobs/filtercompatibletechniquejob.cpp
+++ b/src/render/jobs/filtercompatibletechniquejob.cpp
@@ -80,7 +80,7 @@ void FilterCompatibleTechniqueJob::run()
Q_ASSERT(m_renderer->isRunning());
const std::vector<Qt3DCore::QNodeId> dirtyTechniqueIds = m_manager->takeDirtyTechniques();
- for (const Qt3DCore::QNodeId techniqueId : dirtyTechniqueIds) {
+ for (const Qt3DCore::QNodeId &techniqueId : dirtyTechniqueIds) {
Technique *technique = m_manager->lookupResource(techniqueId);
if (Q_LIKELY(technique != nullptr))
technique->setCompatibleWithRenderer((*m_renderer->contextInfo() == *technique->graphicsApiFilter()));
diff --git a/src/render/jobs/filterlayerentityjob.cpp b/src/render/jobs/filterlayerentityjob.cpp
index 00ed76d86..ddea1ebf7 100644
--- a/src/render/jobs/filterlayerentityjob.cpp
+++ b/src/render/jobs/filterlayerentityjob.cpp
@@ -81,7 +81,7 @@ void FilterLayerEntityJob::filterAcceptAnyMatchingLayers(Entity *entity,
{
const Qt3DCore::QNodeIdVector entityLayers = entity->layerIds();
- for (const Qt3DCore::QNodeId id : entityLayers) {
+ for (const Qt3DCore::QNodeId &id : entityLayers) {
const bool layerAccepted = layerIds.contains(id);
if (layerAccepted) {
@@ -99,7 +99,7 @@ void FilterLayerEntityJob::filterAcceptAllMatchingLayers(Entity *entity,
const Qt3DCore::QNodeIdVector entityLayers = entity->layerIds();
int layersAccepted = 0;
- for (const Qt3DCore::QNodeId id : entityLayers) {
+ for (const Qt3DCore::QNodeId &id : entityLayers) {
if (layerIds.contains(id))
++layersAccepted;
}
@@ -118,7 +118,7 @@ void FilterLayerEntityJob::filterDiscardAnyMatchingLayers(Entity *entity,
const Qt3DCore::QNodeIdVector entityLayers = entity->layerIds();
bool entityCanBeDiscarded = false;
- for (const Qt3DCore::QNodeId id : entityLayers) {
+ for (const Qt3DCore::QNodeId &id : entityLayers) {
if (layerIds.contains(id)) {
entityCanBeDiscarded = true;
break;
@@ -140,7 +140,7 @@ void FilterLayerEntityJob::filterDiscardAllMatchingLayers(Entity *entity,
int containedLayers = 0;
- for (const Qt3DCore::QNodeId id : layerIds) {
+ for (const Qt3DCore::QNodeId &id : layerIds) {
if (entityLayers.contains(id))
++containedLayers;
}
@@ -167,7 +167,7 @@ void FilterLayerEntityJob::filterLayerAndEntity()
FrameGraphManager *frameGraphManager = m_manager->frameGraphManager();
LayerManager *layerManager = m_manager->layerManager();
- for (const Qt3DCore::QNodeId layerFilterId : qAsConst(m_layerFilterIds)) {
+ for (const Qt3DCore::QNodeId &layerFilterId : qAsConst(m_layerFilterIds)) {
LayerFilterNode *layerFilter = static_cast<LayerFilterNode *>(frameGraphManager->lookupNode(layerFilterId));
Qt3DCore::QNodeIdVector layerIds = layerFilter->layerIds();
diff --git a/src/render/jobs/filterproximitydistancejob.cpp b/src/render/jobs/filterproximitydistancejob.cpp
index 90978d573..3a4bf7d89 100644
--- a/src/render/jobs/filterproximitydistancejob.cpp
+++ b/src/render/jobs/filterproximitydistancejob.cpp
@@ -78,7 +78,7 @@ void FilterProximityDistanceJob::run()
FrameGraphManager *frameGraphManager = m_manager->frameGraphManager();
EntityManager *entityManager = m_manager->renderNodesManager();
- for (const Qt3DCore::QNodeId proximityFilterId : qAsConst(m_proximityFilterIds)) {
+ for (const Qt3DCore::QNodeId &proximityFilterId : qAsConst(m_proximityFilterIds)) {
ProximityFilter *proximityFilter = static_cast<ProximityFilter *>(frameGraphManager->lookupNode(proximityFilterId));
m_targetEntity = entityManager->lookupResource(proximityFilter->entityId());
m_distanceThresholdSquared = proximityFilter->distanceThreshold();
diff --git a/src/render/jobs/pickboundingvolumeutils.cpp b/src/render/jobs/pickboundingvolumeutils.cpp
index e3a0e018a..d123b99f2 100644
--- a/src/render/jobs/pickboundingvolumeutils.cpp
+++ b/src/render/jobs/pickboundingvolumeutils.cpp
@@ -854,7 +854,7 @@ bool HierarchicalEntityPicker::collectHits(NodeManagers *manager, Entity *root)
Qt3DCore::QNodeIdVector recursiveLayers;
const Qt3DCore::QNodeIdVector entityLayers = current.entity->componentsUuid<Layer>();
- for (const Qt3DCore::QNodeId layerId : entityLayers) {
+ for (const Qt3DCore::QNodeId &layerId : entityLayers) {
Layer *layer = layerManager->lookupResource(layerId);
if (layer->recursive())
recursiveLayers << layerId;
diff --git a/src/render/jobs/renderviewjobutils.cpp b/src/render/jobs/renderviewjobutils.cpp
index 3677bf4cf..2e707007a 100644
--- a/src/render/jobs/renderviewjobutils.cpp
+++ b/src/render/jobs/renderviewjobutils.cpp
@@ -77,7 +77,7 @@ Technique *findTechniqueForEffect(NodeManagers *manager,
// Iterate through the techniques in the effect
const auto techniqueIds = effect->techniques();
- for (const QNodeId techniqueId : techniqueIds) {
+ for (const QNodeId &techniqueId : techniqueIds) {
Technique *technique = manager->techniqueManager()->lookupResource(techniqueId);
// Should be valid, if not there likely a problem with node addition/destruction changes
@@ -117,7 +117,7 @@ RenderPassList findRenderPassesForTechnique(NodeManagers *manager,
RenderPassList passes;
const auto passIds = technique->renderPasses();
- for (const QNodeId passId : passIds) {
+ for (const QNodeId &passId : passIds) {
RenderPass *renderPass = manager->renderPassManager()->lookupResource(passId);
if (renderPass && renderPass->isEnabled()) {
@@ -128,12 +128,12 @@ RenderPassList findRenderPassesForTechnique(NodeManagers *manager,
// Iterate through the filter criteria and look for render passes with criteria that satisfy them
const auto filterKeyIds = passFilter->filters();
- for (const QNodeId filterKeyId : filterKeyIds) {
+ for (const QNodeId &filterKeyId : filterKeyIds) {
foundMatch = false;
FilterKey *filterFilterKey = manager->filterKeyManager()->lookupResource(filterKeyId);
const auto passFilterKeyIds = renderPass->filterKeys();
- for (const QNodeId passFilterKeyId : passFilterKeyIds) {
+ for (const QNodeId &passFilterKeyId : passFilterKeyIds) {
FilterKey *passFilterKey = manager->filterKeyManager()->lookupResource(passFilterKeyId);
if ((foundMatch = (*passFilterKey == *filterFilterKey)))
break;
@@ -169,7 +169,7 @@ ParameterInfoList::const_iterator findParamInfo(ParameterInfoList *params, const
void addParametersForIds(ParameterInfoList *params, ParameterManager *manager,
const Qt3DCore::QNodeIdVector &parameterIds)
{
- for (const QNodeId paramId : parameterIds) {
+ for (const QNodeId &paramId : parameterIds) {
const HParameter parameterHandle = manager->lookupHandle(paramId);
const Parameter *param = manager->data(parameterHandle);
ParameterInfoList::iterator it = std::lower_bound(params->begin(), params->end(), param->nameId());
diff --git a/src/render/jobs/updateentitylayersjob.cpp b/src/render/jobs/updateentitylayersjob.cpp
index 62b3b1c78..8f9de8ee6 100644
--- a/src/render/jobs/updateentitylayersjob.cpp
+++ b/src/render/jobs/updateentitylayersjob.cpp
@@ -76,7 +76,7 @@ void UpdateEntityLayersJob::run()
Entity *entity = entityManager->data(handle);
const Qt3DCore::QNodeIdVector entityLayers = entity->componentsUuid<Layer>();
- for (const Qt3DCore::QNodeId layerId : entityLayers) {
+ for (const Qt3DCore::QNodeId &layerId : entityLayers) {
Layer *layer = layerManager->lookupResource(layerId);
if (layer->recursive()) {
// Find all children of the entity and add the layers to them
diff --git a/src/render/materialsystem/filterkey.cpp b/src/render/materialsystem/filterkey.cpp
index e6c37b241..c3ed62924 100644
--- a/src/render/materialsystem/filterkey.cpp
+++ b/src/render/materialsystem/filterkey.cpp
@@ -92,7 +92,7 @@ bool FilterKey::operator ==(const FilterKey &other)
// https://codereview.qt-project.org/#/c/204484/
// and adding the following early comparison of the types should give
// an equivalent performance gain:
- return (other.value().type() == value().type() &&
+ return (other.value().metaType() == value().metaType() &&
other.name() == name() &&
other.value() == value());
}
diff --git a/src/render/materialsystem/qparameter.cpp b/src/render/materialsystem/qparameter.cpp
index e5d586519..d4a457115 100644
--- a/src/render/materialsystem/qparameter.cpp
+++ b/src/render/materialsystem/qparameter.cpp
@@ -197,7 +197,7 @@ inline QVariant toBackendValue(const QVariant &v)
void QParameterPrivate::setValue(const QVariant &v)
{
- if (v.type() == QVariant::List) {
+ if (v.metaType().id() == QMetaType::QVariantList) {
QSequentialIterable iterable = v.value<QSequentialIterable>();
QVariantList variants;
variants.reserve(iterable.size());
diff --git a/src/render/materialsystem/shaderdata.cpp b/src/render/materialsystem/shaderdata.cpp
index 8b70b384f..f5e194697 100644
--- a/src/render/materialsystem/shaderdata.cpp
+++ b/src/render/materialsystem/shaderdata.cpp
@@ -127,7 +127,7 @@ void ShaderData::syncFromFrontEnd(const QNode *frontEnd, bool firstTime)
// We check if property is a Transformed property
QString transformedPropertyName;
- if (propertyValue.userType() == QVariant::Vector3D) {
+ if (propertyValue.userType() == QMetaType::QVector3D) {
// if there is a matching QShaderData::TransformType propertyTransformed
transformedPropertyName = propertyName + QLatin1String("Transformed");
isTransformed = propertyNames.contains(transformedPropertyName);
diff --git a/src/render/materialsystem/technique.cpp b/src/render/materialsystem/technique.cpp
index bb3843d5b..4f8673c5b 100644
--- a/src/render/materialsystem/technique.cpp
+++ b/src/render/materialsystem/technique.cpp
@@ -176,12 +176,12 @@ bool Technique::isCompatibleWithFilters(const QNodeIdVector &filterKeyIds)
// Iterate through the filter criteria and for each one search for a criteria on the
// technique that satisfies it
- for (const QNodeId filterKeyId : filterKeyIds) {
+ for (const QNodeId &filterKeyId : filterKeyIds) {
FilterKey *filterKey = m_nodeManager->filterKeyManager()->lookupResource(filterKeyId);
bool foundMatch = false;
- for (const QNodeId techniqueFilterKeyId : qAsConst(m_filterKeyList)) {
+ for (const QNodeId &techniqueFilterKeyId : qAsConst(m_filterKeyList)) {
FilterKey *techniqueFilterKey = m_nodeManager->filterKeyManager()->lookupResource(techniqueFilterKeyId);
if ((foundMatch = (*techniqueFilterKey == *filterKey)))
break;
diff --git a/src/render/shadergraph/qshadergraphloader.cpp b/src/render/shadergraph/qshadergraphloader.cpp
index 64f159e7b..3d95ba69c 100644
--- a/src/render/shadergraph/qshadergraphloader.cpp
+++ b/src/render/shadergraph/qshadergraphloader.cpp
@@ -147,7 +147,7 @@ void QShaderGraphLoader::load()
}
const QJsonArray nodes = nodesValue.toArray();
- for (const QJsonValue &nodeValue : nodes) {
+ for (const QJsonValue nodeValue : nodes) {
if (!nodeValue.isObject()) {
qWarning() << "Invalid node found";
hasError = true;
@@ -173,9 +173,8 @@ void QShaderGraphLoader::load()
const QJsonArray layersArray = nodeObject.value(QStringLiteral("layers")).toArray();
auto layers = QStringList();
- for (const QJsonValue &layerValue : layersArray) {
+ for (const QJsonValue layerValue : layersArray)
layers.append(layerValue.toString());
- }
QShaderNode node = m_prototypes.value(type);
node.setUuid(uuid);
@@ -189,13 +188,13 @@ void QShaderGraphLoader::load()
if (parameterValue.isObject()) {
const QJsonObject parameterObject = parameterValue.toObject();
const QString type = parameterObject.value(QStringLiteral("type")).toString();
- const int typeId = QMetaType::type(type.toUtf8());
+ const QMetaType typeId = QMetaType::fromName(type.toUtf8());
const QString value = parameterObject.value(QStringLiteral("value")).toString();
auto variant = QVariant(value);
- if (QMetaType::typeFlags(typeId) & QMetaType::IsEnumeration) {
- const QMetaObject *metaObject = QMetaType::metaObjectForType(typeId);
+ if (typeId.flags() & QMetaType::IsEnumeration) {
+ const QMetaObject *metaObject = typeId.metaObject();
const char *className = metaObject->className();
const QByteArray enumName = type.mid(static_cast<int>(qstrlen(className)) + 2).toUtf8();
const QMetaEnum metaEnum = metaObject->enumerator(metaObject->indexOfEnumerator(enumName));
@@ -216,7 +215,7 @@ void QShaderGraphLoader::load()
}
const QJsonArray edges = edgesValue.toArray();
- for (const QJsonValue &edgeValue : edges) {
+ for (const QJsonValue edgeValue : edges) {
if (!edgeValue.isObject()) {
qWarning() << "Invalid edge found";
hasError = true;
@@ -247,9 +246,8 @@ void QShaderGraphLoader::load()
const QJsonArray layersArray = edgeObject.value(QStringLiteral("layers")).toArray();
auto layers = QStringList();
- for (const QJsonValue &layerValue : layersArray) {
+ for (const QJsonValue layerValue : layersArray)
layers.append(layerValue.toString());
- }
auto edge = QShaderGraph::Edge();
edge.sourceNodeUuid = sourceUuid;
diff --git a/src/render/shadergraph/qshadernodesloader.cpp b/src/render/shadergraph/qshadernodesloader.cpp
index df34fd1f7..f1239d749 100644
--- a/src/render/shadergraph/qshadernodesloader.cpp
+++ b/src/render/shadergraph/qshadernodesloader.cpp
@@ -123,7 +123,7 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject)
const QJsonValue inputsValue = nodeObject.value(QStringLiteral("inputs"));
if (inputsValue.isArray()) {
const QJsonArray inputsArray = inputsValue.toArray();
- for (const QJsonValue &inputValue : inputsArray) {
+ for (const QJsonValue inputValue : inputsArray) {
if (!inputValue.isString()) {
qWarning() << "Non-string value in inputs";
hasError = true;
@@ -140,7 +140,7 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject)
const QJsonValue outputsValue = nodeObject.value(QStringLiteral("outputs"));
if (outputsValue.isArray()) {
const QJsonArray outputsArray = outputsValue.toArray();
- for (const QJsonValue &outputValue : outputsArray) {
+ for (const QJsonValue outputValue : outputsArray) {
if (!outputValue.isString()) {
qWarning() << "Non-string value in outputs";
hasError = true;
@@ -162,13 +162,13 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject)
if (parameterValue.isObject()) {
const QJsonObject parameterObject = parameterValue.toObject();
const QString type = parameterObject.value(QStringLiteral("type")).toString();
- const int typeId = QMetaType::type(type.toUtf8());
+ const QMetaType typeId = QMetaType::fromName(type.toUtf8());
const QString value = parameterObject.value(QStringLiteral("value")).toString();
auto variant = QVariant(value);
- if (QMetaType::typeFlags(typeId) & QMetaType::IsEnumeration) {
- const QMetaObject *metaObject = QMetaType::metaObjectForType(typeId);
+ if (typeId.flags() & QMetaType::IsEnumeration) {
+ const QMetaObject *metaObject = typeId.metaObject();
const char *className = metaObject->className();
const QByteArray enumName = type.mid(static_cast<int>(qstrlen(className)) + 2).toUtf8();
const QMetaEnum metaEnum = metaObject->enumerator(metaObject->indexOfEnumerator(enumName));
@@ -188,7 +188,7 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject)
const QJsonValue rulesValue = nodeObject.value(QStringLiteral("rules"));
if (rulesValue.isArray()) {
const QJsonArray rulesArray = rulesValue.toArray();
- for (const QJsonValue &ruleValue : rulesArray) {
+ for (const QJsonValue ruleValue : rulesArray) {
if (!ruleValue.isObject()) {
qWarning() << "Rules should be objects";
hasError = true;