summaryrefslogtreecommitdiffstats
path: root/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-11-20 21:43:28 +0000
committerMike Krus <mike.krus@kdab.com>2021-01-08 15:29:30 +0000
commitcf7127a7897b072af16a78139afc6059e9e7c9a5 (patch)
treee43bcc1fc090021c980adc06ed9673b1894f4a67 /src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
parent044325863c033c3fb877094f39c1638bc276d87e (diff)
Handle changes in QMetaType API
Updates to support building with Qt6 and Qt5.15 Change-Id: I9f06d810c943a348e6a060f4ea35ed870f21694a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/plugins/sceneparsers/gltfexport/gltfexporter.cpp')
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
index 6847b4897..21396b215 100644
--- a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
+++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
@@ -662,7 +662,11 @@ void GLTFExporter::parseMaterials()
if (material->effect()) {
QList<QParameter *> parameters = material->effect()->parameters();
for (auto param : parameters) {
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (param->value().metaType().id() == QMetaType::QColor) {
+#else
+ if (param->value().type() == QMetaType::QColor) {
+#endif
QColor color = param->value().value<QColor>();
if (param->name() == MATERIAL_AMBIENT_COLOR) {
matInfo.colors.insert(QStringLiteral("ambient"), color);
@@ -1799,7 +1803,11 @@ void GLTFExporter::exportParameter(QJsonObject &jsonObj, const QString &name,
paramObj[typeStr] = GL_SAMPLER_2D;
paramObj[valueStr] = m_textureIdMap.value(textureVariantToUrl(variant));
} else {
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
switch (variant.metaType().id()) {
+#else
+ switch (variant.type()) {
+#endif
case QMetaType::Bool:
paramObj[typeStr] = GL_BOOL;
paramObj[valueStr] = variant.toBool();
@@ -2071,7 +2079,11 @@ QString GLTFExporter::textureVariantToUrl(const QVariant &var)
void GLTFExporter::setVarToJSonObject(QJsonObject &jsObj, const QString &key, const QVariant &var)
{
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
switch (var.metaType().id()) {
+#else
+ switch (var.type()) {
+#endif
case QMetaType::Bool:
jsObj[key] = var.toBool();
break;