# Pastebin laD6pZqz void updateSourceObject(PyObject *source) { // TODO: Provide for actual upstream exception handling. // For now we'll just return early to avoid further issues. if (source == nullptr) // Bad input return; Shiboken::AutoDecRef mroIterator(PyObject_GetIter(source->ob_type->tp_mro)); if (mroIterator.isNull()) // Not iterable return; Shiboken::AutoDecRef mroItem{}; while ((mroItem.reset(PyIter_Next(mroIterator))), mroItem.object()) { Py_ssize_t pos = 0; PyObject *key, *value; auto *type = reinterpret_cast(mroItem.object()); while (PyDict_Next(type->tp_dict, &pos, &key, &value)) { if (PyObject_TypeCheck(value, PySideSignalTypeF())) { auto *inst = PyObject_New(PySideSignalInstance, PySideSignalInstanceTypeF()); Shiboken::AutoDecRef signalInstance(reinterpret_cast(inst)); instanceInitialize(signalInstance.cast(), key, reinterpret_cast(value), source, 0); if (PyObject_SetAttr(source, key, signalInstance) == -1) return; // An error occurred while setting the attribute } } } if (PyErr_Occurred()) // An iteration error occurred return; }