From 05d8ae65fed2f8b719adda26ee46ec0d7b5841b0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 2 Nov 2023 12:30:29 +0100 Subject: [PATCH] Material: QMetaType::type(const char*) is deprecatred and shouldn't be used in new code And it looks like that QMetaType::type("Base::Quantity") neither works with Qt5 nor with Qt6 because it returns 0 as id that means the type is unknown. --- src/Mod/Material/App/MaterialPyImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Material/App/MaterialPyImpl.cpp b/src/Mod/Material/App/MaterialPyImpl.cpp index 49d3668e99..449a81e521 100644 --- a/src/Mod/Material/App/MaterialPyImpl.cpp +++ b/src/Mod/Material/App/MaterialPyImpl.cpp @@ -350,7 +350,7 @@ static PyObject* _pyObjectFromVariant(const QVariant& value) return new PyObject(); } - if (value.userType() == QMetaType::type("Base::Quantity")) { + if (value.userType() == qMetaTypeId()) { return new Base::QuantityPy(new Base::Quantity(value.value())); } else if (value.userType() == QMetaType::Double) {