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.
This commit is contained in:
wmayer
2023-11-02 12:30:29 +01:00
committed by wwmayer
parent 4f24d60675
commit 05d8ae65fe

View File

@@ -350,7 +350,7 @@ static PyObject* _pyObjectFromVariant(const QVariant& value)
return new PyObject();
}
if (value.userType() == QMetaType::type("Base::Quantity")) {
if (value.userType() == qMetaTypeId<Base::Quantity>()) {
return new Base::QuantityPy(new Base::Quantity(value.value<Base::Quantity>()));
}
else if (value.userType() == QMetaType::Double) {