check for existence of PySide stuff when defining convertWrapperToQuantity

This commit is contained in:
wmayer
2018-10-24 23:12:59 +02:00
parent 36029e96d6
commit 2004653fe4

View File

@@ -161,7 +161,7 @@ PythonToCppFunc isBaseQuantity_PythonToCpp_QVariantConvertible(PyObject* obj)
return 0;
}
#if QT_VERSION >= 0x050200
#if defined (HAVE_PYSIDE) && QT_VERSION >= 0x050200
Base::Quantity convertWrapperToQuantity(const PySide::PyObjectWrapper &w)
{
PyObject* pyIn = static_cast<PyObject*>(w);
@@ -191,7 +191,7 @@ void registerTypes()
isBaseQuantity_PythonToCpp_QVariantConvertible);
}
#if QT_VERSION >= 0x050200
#if defined (HAVE_PYSIDE) && QT_VERSION >= 0x050200
QMetaType::registerConverter<PySide::PyObjectWrapper, Base::Quantity>(&convertWrapperToQuantity);
#endif
}