aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/qobjectconnect.cpp
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2022-03-13 19:22:02 +0100
committerChristian Tismer <tismer@stackless.com>2022-03-17 19:27:13 +0100
commit3c7c58e341685cae77a3ab7d0bb0595423feac1b (patch)
treecb7494212edaa57a17bf6d461676372fe293d805 /sources/pyside6/libpyside/qobjectconnect.cpp
parente188311347c071629d78627ad16f47a8096a1cce (diff)
PyPySide: fix callbacks with the new "builtin method" type
Using this new type, two more errors concerning callbacks could be resolved: signals::qobject_receivers_test QtWidgets::bug_860 [ChangeLog][PySide6] The new PyPy "builtin method" is now handled correctly in callback functions. Task-number: PYSIDE-1843 Task-number: PYSIDE-535 Change-Id: I0f24cf6d7c0352b853f663ffcaf899d3eb77c7e8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/qobjectconnect.cpp')
-rw-r--r--sources/pyside6/libpyside/qobjectconnect.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/qobjectconnect.cpp b/sources/pyside6/libpyside/qobjectconnect.cpp
index e8a2b84dd..5dca74f47 100644
--- a/sources/pyside6/libpyside/qobjectconnect.cpp
+++ b/sources/pyside6/libpyside/qobjectconnect.cpp
@@ -113,6 +113,12 @@ static GetReceiverResult getReceiver(QObject *source, const char *signal,
result.self = PyMethod_GET_SELF(callback);
result.receiver = PySide::convertToQObject(result.self, false);
forceGlobalReceiver = isMethodDecorator(callback, true, result.self);
+#ifdef PYPY_VERSION
+ } else if (Py_TYPE(callback) == PepBuiltinMethod_TypePtr) {
+ result.self = PyObject_GetAttrString(callback, "__self__");
+ Py_DECREF(result.self);
+ result.receiver = PySide::convertToQObject(result.self, false);
+#endif
} else if (PyCFunction_Check(callback)) {
result.self = PyCFunction_GET_SELF(callback);
result.receiver = PySide::convertToQObject(result.self, false);