aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/glue/qobject_connect.cpp
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-12-29 17:04:56 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-01-04 15:48:36 -0200
commit85048bbd6c5d4231f71852cab18fd581c5068141 (patch)
treef1a1b38b04e748c0c50825d51d38c7dafe7ee60e /PySide/QtCore/glue/qobject_connect.cpp
parente8e1ecc260028d045efcbc3c71d7a50009950f5b (diff)
Fixes problems calling dynamic python slots.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'PySide/QtCore/glue/qobject_connect.cpp')
-rw-r--r--PySide/QtCore/glue/qobject_connect.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index 5fe0ac427..846ab5012 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -54,13 +54,17 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
self = PyMethod_GET_SELF(callback);
if (SbkQObject_Check(self))
receiver = SbkQObject_cptr(self);
+ } else if (PyCFunction_Check(callback)) {
+ self = PyCFunction_GET_SELF(callback);
+ if (self && SbkQObject_Check(self))
+ receiver = SbkQObject_cptr(self);
}
usingGlobalReceiver = !receiver;
if (usingGlobalReceiver)
receiver = signalManager.globalReceiver();
metaObject = receiver->metaObject();
- const QByteArray callbackSig = PySide::getCallbackSignature(signal, callback).toAscii();
+ const QByteArray callbackSig = PySide::getCallbackSignature(signal, callback, usingGlobalReceiver).toAscii();
const char* slot = callbackSig.constData();
int slotIndex = metaObject->indexOfSlot(slot);
if (slotIndex == -1) {