aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/signalmanager.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* PySide6: Handle not finding a slot by nameFriedemann Kleint2022-04-211-1/+6
| | | | | | Pick-to: 6.2 5.15 Change-Id: Ie2c652223aaaa853c99d540acebb99f754f34d61 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Port code to use size() instead of count() of Qt containersFriedemann Kleint2022-03-171-2/+2
| | | | | | | | | | | count() will be deprecated. Fix some integer types in loops and modernize code in changed lines. Pick-to: 6.2 Change-Id: Idf21927661ea6c8866ee36e7c623043271e21620 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Refactor handling of QmlListPropertyFriedemann Kleint2022-02-241-1/+1
| | | | | | | | | | | | | PySidePropertyPrivate had a function pointer for the meta call handler that was set to an internal function for most properties. QmlListProperty would set it to a different function along with user data. Turn this into a virtual function of PySidePropertyPrivate and override it in QmlListPropertyPrivate. The function pointer and the user data pointer can then be removed. Task-number: PYSIDE-1827 Change-Id: I9c6452e2d39d5fd9b14d4c74ab7ed2fad483af29 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Refactor SignalManager::qt_metacall()Friedemann Kleint2022-02-241-88/+99
| | | | | | | | | | | | | The logic of SignalManager::qt_metacall() instantiated a number of variables that were only relevant for properties in each call and locked and released the GIL multiple times. Split it apart into separate handler for properties and method invocations and reduce the GIL allocations. Task-number: PYSIDE-1827 Change-Id: I171853d1bd95dc3d8437c64075448a08af2ea7e0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Move helper isCompiledMethod() to pysideutils.hFriedemann Kleint2022-01-191-7/+0
| | | | | | | | | | | It appears to be a general use helper function which could be useful outside signalmanager as well. Amends 56f66f128566bd08f027fee46bb42a6c4f57a26e. Task-number: PYSIDE-1755 Change-Id: I449243bb5d800ba4d271b3079ad394810d468312 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Safe distinction of Nuitka compiled methodsShyamnath Premnadh2022-01-181-0/+7
| | | | | | | | | | | | | | | | | | Adds an extra check to see if __code__ is present. As mentioned in PYSIDE-1755, Mocks are callable objects without __code__ attribute, unlike Python Method or Functions. However, a Mock also has im_func__ and im__self attributes. We made the assumption __code__ would be present if im_func and im_self are present, and this makes it fall under the category of a compiled method. This patch makes an extra check to see if __code__ is present. If it is not, then the Slot (here Mock) is considered as a callable method. Task-number: PYSIDE-1755 Pick-to: 6.2 Change-Id: If7e8f52dfb2409cd856eec0d0b41891d751d8a69 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPySide: Do some cleanup and ImprovementsChristian Tismer2022-01-051-2/+2
| | | | | | | | | | | | | For more clarity, the function SbkObject_GetDict is renamed to SbkObject_GetDict_NoRef. The internal __dict__ implementation SbkObjectGetDict is re-written to use SbkObject_GetDict_NoRef, which is more correct because of PyPy's tp_dict handling. Task-number: PYSIDE-535 Change-Id: I28034d9199918859de809fde08c413b4b66a3136 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyPySide: Avoid direct access to `op->ob_dict` in PyPyChristian Tismer2021-12-031-3/+4
| | | | | | | | | | | | | | | | | | | | | | | PyPy treats `op->ob_dict` specially. When you use PyObject_SetAttr and look later for the attribute in the object's dict, you cannot find it. PySide uses direct access to `ob_dict` which has this side effect and was a major obstacle until the PyPy people explained the undocumented behavior. We either need to use a different attribute name than "ob_dict", or use the C API for dict access. The second, simpler solution turned out to be sufficient. Since the used function is in the Stable ABI in version Python 3.10 only, we implemented a replacement function in basewrapper. This change was crucial and led to the first public version. [ChangeLog][shiboken6] PyPySide: Direct access to `op->ob_dict` needed to be avoided in PyPy. This important change took the project far enough to publish it as a preview and to produce wheels. Task-number: PYSIDE-535 Change-Id: I09c59e7ebf78837868912cfd19330256eea71237 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside: Split up the pyside.h headerFriedemann Kleint2021-11-261-1/+1
| | | | | | | | | | | | | | | | Changing something in pyside.h caused excessive recompiling of all wrappers. Try to amend the situation by splitting up the header and include only what is needed. pyside.h remains as a header including the others which will be emptied out by further changes splitting out QML functionality. [ChangeLog][PySide6] The header pyside.h has been split into smaller headers. Task-number: PYSIDE-1709 Change-Id: I89ff3d9d9bc486f194ad3ec62ed372ff0be960f2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Remove QML dependency from libpysideFriedemann Kleint2021-11-111-37/+14
| | | | | | | | | | | | | | Remove the QML error handling from SignalHandler by introducing a function pointer for this which can set from the QML module. This allows for removing QtQml from the libpyside dependencies, removing the need to deploy the QtQml libraries with widget applications. [ChangeLog][PySide6] libpyside no longer depends on QtQml. Change-Id: Iae7dabdd38ea03156f4c00073d84e42ec5a3d892 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove some C-style castsFriedemann Kleint2021-09-131-1/+2
| | | | | Change-Id: Ib600eff6f4a2baa32dbda781c0c95286e9ba5c58 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Fix some clang analzyer warningsFriedemann Kleint2021-03-111-23/+20
| | | | | | | | | | | | - Use nullptr - Initialize variables - Remove else after return - Remove C-style casts - Avoid constructing QString from const char * - Use emit for signals Change-Id: I6ba8cad51f4b2a22f94996d1a9d8c3ae87c35099 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Refactor GlobalReceiverV2MapFriedemann Kleint2020-11-171-7/+6
| | | | | | | | | | | | | | | | Use a QHash of object/method PyObject instead of a QByteArray representing the sum of hash values of both as a string. The problem with using hash functions here is that 2 keys might be identical due to the hashing. Rename the hash() methods to key(). Task-number: PYSIDE-1422 Change-Id: Ie1344d8bd85a073ef5f6e2cb461bd2f514265a9f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Small nullptr-cleanupFriedemann Kleint2020-11-171-5/+5
| | | | | Change-Id: I9688480a24bafa7808796a6161cf3474f2ca44f8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-021-0/+640
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>