diff --git a/src/PythonQt.cpp b/src/PythonQt.cpp index 2b016ec83..c7e76ea61 100644 --- a/src/PythonQt.cpp +++ b/src/PythonQt.cpp @@ -121,7 +121,11 @@ void PythonQt::init(int flags, const QByteArray& pythonQtModuleName) PythonQtMethodInfo::addParameterTypeAlias("QObjectList", "QList"); qRegisterMetaType>("QList"); - qRegisterMetaType("QObjectList"); + // QObjectList might already be registered by other modules (e.g. QtScript) or under different type names. + // To avoid conflicts or warnings, only register it if it is currently unknown. + if (QMetaType::type("QObjectList") == QMetaType::UnknownType) { + qRegisterMetaType("QObjectList"); + } qRegisterMetaType>("QList"); if (QT_POINTER_SIZE == 8) { qRegisterMetaType("size_t");