aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/pysidesignal.h
Commit message (Collapse)AuthorAgeFilesLines
* libpyside/ PySideSignal: Fix a memory leak connecting to signalsFriedemann Kleint2024-12-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Change dc7acd1f2dc750c3c8602203ae1558b0e60a3c17 added a reference to signal senders not created in Python to fix a crash when doing something like: QAbstractItemView.selectionModel().currentChanged.connect(...) In addition, the code kept a weakref on the sender and tracked its deletion. To simplify this, keep a tracking QPointer on the sender QObject and its PyTypeObject * instead of a PyObject * . This also allows for calling QObject::connect() and other helpers directly instead of using PyObject_CallObject() on the PyObject * to forward the calls. Fixes: PYSIDE-2793 Fixes: PYSIDE-1057 Task-number: PYSIDE-79 Change-Id: I1ce6f4c35c819f3e815161788cdef964ffc6fd96 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside/ PySideSignal: Reduce number of weakref handlers for sender trackingFriedemann Kleint2024-12-161-1/+0
| | | | | | | | | | | | | | Introduce a struct shared by shared_ptr in all instances of PySideSignalInstancePrivate that is tracked by the weak reference. Amends db40e3e07932576bc54cd922eecd423c0f675613 Task-number: PYSIDE-2201 Task-number: PYSIDE-79 Pick-to: 6.8 Change-Id: Ic7bb836422f3843a02474f2bb92641b8a9ebc824 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Avoid splitting/reassembling of signal/slot signaturesFriedemann Kleint2024-07-101-11/+1
| | | | | | | | | | | | Instead of parsing the signature from the string, pass the signal QMetaMethod into getReceiver(), which has the parameter types. The helper getArgsFromSignature() can then be removed. Task-number: PYSIDE-2810 Change-Id: I506e058d3fbe1cb0d6db599742a0ffc35db634d4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Remove short circuit signal handlingFriedemann Kleint2024-05-271-3/+1
| | | | | | | | | | | There was a "Short circuit" code path triggering on QMetaMethod signal signatures without parentheses, which is apparently dead. Task-number: PYSIDE-2667 Change-Id: I68c4c636ea224a7691e76286ed43f5aaaa6d4bd7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* libpyside: Port the signal signature code from QString to QByteArrayFriedemann Kleint2023-11-161-3/+4
| | | | | | | | | | Since the name ends up in QMetaObject::addSlot() taking a QByteArray anyways, there is no point in constructing the name using QString. Task-number: PYSIDE-2524 Change-Id: Ib27a55efa8b22eb983d5e27e3a981efd72e9996f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix namespacesFriedemann Kleint2023-09-201-4/+2
| | | | | | | | | | | - Use nested namespaces instead repetitive namespace declaration - Remove anonymous namespaces that contain only static functions. "static" is sufficient here, the anonymous namespace only increases compilation time. Pick-to: 6.6 6.5 Change-Id: I6cd1b63da79eaf40a1b7ae031def97fa22903e99 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide6: Add a convenience function for retrieving signal emittersFriedemann Kleint2023-07-261-0/+12
| | | | | | Task-number: PYSIDE-2384 Change-Id: I38cd611439a882e65f9f3bc6ca47dedd0a4fc66c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* signals: Introduce Weak Reference to protect lost SignalInstanceChristian Tismer2023-02-021-0/+1
| | | | | | | | | | | | | | | | This first solution detects the vanishing object and raises an exception. Trying to revive the object was unsuccessful. Since this happens only when no signals are connected, it is ok to leave it this way. Change-Id: Ib47f85657363b675cec3616b5550ce41d93fb4d3 Fixes: PYSIDE-2201 Pick-to: 6.4 Task-number: PYSIDE-79 Task-number: PYSIDE-68 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-271-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyPySide: Rename interface functions and classes to simplify debuggingChristian Tismer2022-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The names of certain interface functions are not always following a simple scheme. Especially it is not easy to see immediately if we are dealing with a method of SbkObjectType or SbkObject Do a few renamings to simplify debugging and make the code easier to understand. When a function is used in a type spec and there is no other important reason, it should be named like {Py_<tpname>: reinterpret_cast<void *>(<TypeName>_<tpname>)}, Rename also all type functions ending on "TypeF()" to end in "_TypeF()". This is not always the case. Examples: SbkObjectTpNew -> SbkObject_tp_new SbkObjecttypeTpNew -> SbkObjectType_tp_new PyClassPropertyTypeF -> PyClassProperty_TypeF Task-number: PYSIDE-535 Change-Id: Icbd118852f2ee732b55d944ed57c7a8ef7d26139 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove SbkObjectType from the APIFriedemann Kleint2021-09-131-1/+1
| | | | | | | | | | Leave only a deprecated typedef. Complements a4311711eb89e3f9833a05edf3debdf7563a104f. Task-number: PYSIDE-535 Change-Id: Icab9e82e7bff99363c01e471db1c84ee8d6c0b6b Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Add type check for PySideSignalInstanceTypeFriedemann Kleint2021-06-091-1/+15
| | | | | | | Pick-to: 6.1 Task-number: PYSIDE-1482 Change-Id: I00d30c95bd5835b6d904bc28f671e284017fffb5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Small nullptr-cleanupFriedemann Kleint2020-11-171-1/+2
| | | | | Change-Id: I9688480a24bafa7808796a6161cf3474f2ca44f8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-021-0/+163
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>