summaryrefslogtreecommitdiffstats
path: root/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
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 /src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
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 'src/plugins/sceneparsers/gltfexport/gltfexporter.cpp')
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.cpp12
1 files changed, 6 insertions, 6 deletions
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;