diff options
Diffstat (limited to 'PySide')
-rw-r--r-- | PySide/QtCore/glue/qobject_connect.cpp | 11 | ||||
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp index b140374ec..cf7877912 100644 --- a/PySide/QtCore/glue/qobject_connect.cpp +++ b/PySide/QtCore/glue/qobject_connect.cpp @@ -75,6 +75,8 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject slotIndex = metaObject->indexOfSlot(slot); } if (QMetaObject::connect(source, signalIndex, receiver, slotIndex, type)) { + if (usingGlobalReceiver) + signalManager.globalReceiverConnectNotify(source, slotIndex); #ifndef AVOID_PROTECTED_HACK source->connectNotify(signal - 1); #else @@ -82,8 +84,6 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject // connectNotify when avoiding the protected hack. reinterpret_cast<QObjectWrapper*>(source)->connectNotify(signal - 1); #endif - if (usingGlobalReceiver) - signalManager.globalReceiverConnectNotify(source, slotIndex); return true; } @@ -114,6 +114,13 @@ static bool qobjectDisconnectCallback(QObject* source, const char* signal, PyObj if (usingGlobalReceiver) { int slotIndex = metaObject->indexOfSlot(callbackSig.constData()); signalManager.globalReceiverDisconnectNotify(source, slotIndex); + #ifndef AVOID_PROTECTED_HACK + source->disconnectNotify(signal - 1); + #else + // Need to cast to QObjectWrapper* and call the public version of + // connectNotify when avoiding the protected hack. + reinterpret_cast<QObjectWrapper*>(source)->disconnectNotify(signal - 1); + #endif } return true; } diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 4d7e3e4f7..c0b333ff4 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -1230,8 +1230,10 @@ <inject-code class="target" position="beginning"> // Avoid return +1 because SignalManager connect to "destroyed()" signal to control object timelife int ret = %CPPSELF.%FUNCTION_NAME(%1); - if (ret > 0 && strcmp(%1, SIGNAL(destroyed())) == 0 && PySide::SignalManager::instance().hasConnectionWith(%CPPSELF)) - ret--; + if (ret > 0 && ((strcmp(%1, SIGNAL(destroyed())) == 0) || (strcmp(%1, SIGNAL(destroyed(QObject*))) == 0))) { + if (PySide::SignalManager::instance().hasConnectionWith(%CPPSELF)) + ret--; + } %PYARG_0 = %CONVERTTOPYTHON[int](ret); </inject-code> </modify-function> |