aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/signalmanager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* limited api: Remove PyBytes_AS_STRING and PyBytes_GET_SIZECristián Maureira-Fredes2024-11-081-2/+2
| | | | | | | | | Remove old macros usages for the Limited API compatibility, and doing some refactorings to their usages. Change-Id: I10d675a1831d26b3fc878151e3a6ec40c5caddb1 Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* limited api: Remove PyTuple_GET_ITEM, PyTuple_SET_ITEM, and PyTuple_GET_SIZE ↵Cristián Maureira-Fredes2024-11-081-1/+1
| | | | | | | | | | | macros Removing old macros for compatibility with the limited api, and refactoring some of their usages Change-Id: I33954199d2ef9884c64b963863b97aed851c440f Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix error handling in non-slot connection receiversFriedemann Kleint2024-10-211-0/+4
| | | | | | | | | | | | | | | Extract the error handling code which existed duplicated in GlobalReceiverV2::qt_metacall() and SignalManagerPrivate::handleMetaCallError() as a static helper of SignalManager and call that from the DynamicSlot functions. Amends 33bd61d13d8d9e3794b6049891be62f3351313d9. Pick-to: 6.8 6.8.0 Task-number: PYSIDE-2810 Fixes: PYSIDE-2900 Change-Id: Ife9f156e6752dde7002218d36d369ba68ad595b0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Reimplement signal connections for Python callables not targeting ↵Friedemann Kleint2024-08-211-207/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | a QMetaMethod The code previously used a instances of class GlobalReceiverV2 inheriting QObject in a hash in SignalManager per slot tracking the list of senders to be able to use standard signal/slot connections in Qt. This was a complicated data structure and had issues with cleanups. This has been replaced by using an invoker object based on QtPrivate::QSlotObjectBase which can be passed to QObjectPrivate::connect(const QObject *, int signal, QtPrivate::QSlotObjectBase *, ...). The connections (identified by ConnectionKey) are now stored in a hash with QMetaObject::Connection as value, which can be used to disconnect using QObject::disconnect(QMetaObject::Connection). Deletion tracking is done by using signal QObject::destroyed(QObject*) which requires adapting some tests checking on the connection count and weak ref notification on receivers as was the case before. [ChangeLog][PySide6] Signal connections for Python callables not targeting a QMetaMethod has be reimplemented to simplify code and prepare for removal of the GIL. Task-number: PYSIDE-2810 Task-number: PYSIDE-2221 Change-Id: Ib55e73d4d7bfe6d7a8b7adc3ce3734eac5789bea Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Refactor signature handling in GlobalReceiverV2Friedemann Kleint2024-07-091-1/+1
| | | | | | | | | | | | Move the signatures hash from DynamicSlotDataV2 into GlobalReceiverV2 to avoid unnecessary indirections and to enable further refactorings of DynamicSlotDataV2. Use QByteArray for the signature parameters, avoiding the conversion. Task-number: PYSIDE-2810 Change-Id: I17a637e28e9dac4ea159b26a375e8c1535e00814 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Pass MetaObjectBuilder signature as QByteArrayFriedemann Kleint2024-07-091-35/+59
| | | | | | | | | | | | | | Change the MetaObjectBuilder::addSlot()/addSignal() functions to use a QByteArray since the underlying QMetaObjectBuilder takes QByteArray, too. Split SignalManager::registerMetaMethodGetIndex() into overloads for const char * (for the signal code path) and QByteArray (for the slot code path). Task-number: PYSIDE-2810 Change-Id: Ie79ea071a8cc111d45248c7086cf6fda34a7548f Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Decouple SignalManager::callPythonMetaMethod() from QMetaMethodFriedemann Kleint2024-07-041-46/+118
| | | | | | | | Extract a helper for calling Python slots and add an overload that only takes a list of parameter types and return type. Change-Id: I407c3b1ae66eb4f01370ceac3112eb9407796efa Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Fix static analysis warningsFriedemann Kleint2024-06-241-9/+11
| | | | | | | | | | | | | | | | - Initialize variables - Use auto * - Remove repeated return types - Fix else after return - Fix some invocations of static methods - Make functions const/static where appropriate - Fix some int types to avoid lossy conversions - Use Py_RETURN_NONE where appropriate - Minor cleanups - Remove some macros Change-Id: I7fa7a29e7b3dc47037027978001824e0709d001f Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Remove short circuit signal handlingFriedemann Kleint2024-05-271-24/+5
| | | | | | | | | | | 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>
* Multimedia: Adapt to revert of QAudio->QtAudio namespace renamingFriedemann Kleint2024-04-121-5/+0
| | | | | | | | | | | | Partially revert 4d761eaaf852f8d82925e111150f25c0dd5f3e83. Adapt to qtmultimedia/7fcea568c9c64f3bcebda21f0df02aa0107dfd0c, reverting qtmultimedia/edaec2bf714c98d65f12c8ed9a2ffbd1603635a7. Task-number: QTBUG-123997 Pick-to: 6.7 Change-Id: Ibd0ad737293f4b9107909f37554c03f64bce5d1e Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside/Signal manager: Ensure cleanup of main thread targetsFriedemann Kleint2024-04-021-4/+65
| | | | | | | | | | | | | | | | Restore a notification on a sender's QObject::destroy() signal for main thread objects. Instead of triggering instant deletion as was done before (causing issues with recursion and threads), start an idle timer to call the Signal manager cleanup. Amends 1270a9e82e5bc3bd53a1131698ece60403da1192. Pick-to: 6.7 Task-number: PYSIDE-2646 Task-number: PYSIDE-2141 Change-Id: Ifdc28f729cab64d58ac2ab300daece98b167d915 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Clean up lambdas connected to signals earlier in shutdownFriedemann Kleint2024-03-251-1/+20
| | | | | | | | | | | Run a signal handler cleanup in CoreApplication::aboutToQuit() already before the general cleanup. This prevents them from leaking out of a main() function, for example. Task-number: PYSIDE-2646 Pick-to: 6.7 6.6 6.5 Change-Id: I87cce8d131c40c02b44b0102b3774477676b8f89 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Fix spelling error in function nameFriedemann Kleint2024-03-251-8/+8
| | | | | | | | | | Amends 1270a9e82e5bc3bd53a1131698ece60403da1192. Task-number: PYSIDE-2646 Task-number: PYSIDE-2141 Pick-to: 6.7 6.6 6.5 Change-Id: Ib8a5146766166ec4fa7ae7b42ce6d52ccae0b3c6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Improve type conversion error messages of metafunction invocationFriedemann Kleint2024-03-131-21/+36
| | | | | | | | | Refactor and streamline the code a bit. Pick-to: 6.6 Task-number: PYSIDE-2633 Change-Id: I433b136ac036a9a297d2c22ad8dfa6af45ad46b0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Adapt to renaming of namespace QAudio->QtAudioFriedemann Kleint2024-02-281-1/+9
| | | | | | | | | | | - Adapt the examples. - Create an alias into the module. - Add a hack to the signal manager for signals which maintain the old string-based signature. Task-number: PYSIDE-2497 Change-Id: I9db5e59851a2cb9161fdcecf87e78d980eda2045 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Improve error messages around signal/slot connectionsFriedemann Kleint2023-10-171-3/+5
| | | | | | | Task-number: PYSIDE-2487 Pick-to: 6.6 6.5 Change-Id: I93d2c350aecf1339c6b18496f376d04cdd37dc29 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libshiboken/libpyside: Fix special functionsFriedemann Kleint2023-10-061-0/+3
| | | | | | | | Pick-to: 6.6 Task-number: PYSIDE-2479 Change-Id: I6df19d487be7087f17e37bea3ea30a66e9b24ed7 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix namespacesFriedemann Kleint2023-09-201-19/+11
| | | | | | | | | | | - 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>
* Adapt to Qt 6.6Friedemann Kleint2023-07-071-0/+4
| | | | | | Change-Id: Ie6379044282809fe73790d03cd086845bee98089 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PyEnum: Shortcut old Enum code and generate Python enums directlyChristian Tismer2023-06-301-1/+0
| | | | | | | | | | | | | | | | | The amalgamation of old and new enums is slowly unraveling from the inside. This meanwhile actually removes the old code. Included a change by Friedemann to improve enum value handling. After the signed/unsigned problem was fixed, there was only one case left where Qt and Clang parser disagreed which could be fixed. The final solution uses overloaded functions to generate all necessary cases with minimal footprint in the executable. Task-number: PYSIDE-1735 Change-Id: I3741ce8621e783a750f3c05241c916008f78f39b Done-with: Friedemann.Kleint@qt.io (+2 squashed commits) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6/SignalManager: Fix memory leaks connecting free methods/lambdasFriedemann Kleint2023-06-281-0/+19
| | | | | | | | | | | | | | | | | Change 1270a9e82e5bc3bd53a1131698ece60403da1192 changed the deletion of global receivers from listening to QObject::destroyed() (which caused thread issues) to using QPointer<> and purging the lists in notify. What is missing was the deletion of global receivers that are not tied by weak reference to a Python instance. Add a check in notify() to clean out the empty global receivers. Pick-to: 6.5 Fixes: PYSIDE-2371 Fixes: PYSIDE-2299 Task-number: PYSIDE-2141 Change-Id: I39dca2a21088930c9a7f8e5eb7e948b3fff49b4b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Enum: Enable toInt for QVariant(PyEnum/SbkEnum)Shyamnath Premnadh2023-06-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | - For Python/Shiboken types not known to Qt that requires wrapping around a QVariant, we use the PyObjectWrapper type. This patch registers a toInt() QMetaType converter for PyObjectWrapper, which enables automatic conversion to int for a QVariant(PyObjectWrapper) within C++ i.e. QVariant(PyObjectWrapper).toInt() will work - This means that cases like QAbstractItemModel::data() that calls QtPrivate::legacyEnumValueFromModelData(const QVariant &data) would work without explicit conversion from QVariant(PyObjectWrapper) to QVariant(int). But for cases like QMetaProperty::write() explcit handling is still required. - This would also work for cases where the QVariant(PyObjectWrapper) is simply channeled from Python to C++, and from C++ back to Python without performing any operations on it. - Incase, the wrapped object is not a PyEnum/ShibokenEnum object, then toInt() would return a -1. Pick-to: 6.5 Task-number: PYSIDE-1930 Task-number: PYSIDE-2339 Change-Id: I983351f2ff88c79c29399c257e38421116efc7a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Implement raising of unraisable exceptions correctlyChristian Tismer2023-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | TODO in another check-in: Control exec/run by an XML attribute [ChangeLog][PySide6] Unraisable exceptions are now handled by a handler on the stack or printed if impossible. Unraisable exceptions are stored in an error store if there is an error handler on the call stack that can handle it, otherwise it is printed immediately. We record the existence of an error handler in thread local storage, which solves thread problems automatically. Since exec and run functions completely block all handlers, we need to mark them as a special case. The overhead is minimal and uses constant memory per thread. Task-number: PYSIDE-2310 Task-number: PYSIDE-2321 Change-Id: Ic25a2ff8552baf6e132ad86a4ad0925375e7ea88 Fixes: PYSIDE-2335 Pick-to: 6.5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Shiboken: Undo the unraisable exception delay for nowChristian Tismer2023-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | The delayed exception looked good in the first place. PYSIDE-2310 and PSIDE-2321 showed some special cases where the delayed error reporting fails to notify about an error, to be in time (2321) or all-together (2310). This is no complete reversal of the thing. We need to improve the theory to cover all cases and do a better implementation. This temporary reversal removes the pressure from us to get the feature perfect before the 6.5.1 release. Change-Id: Idf25ca31571a45c59082d27e4d736a4932ab9f8c Fixes: PYSIDE-2310 Fixes: PYSIDE-2321 Pick-to: 6.5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* property/QML: Improve handling of an unknown class nameChristian Tismer2023-01-061-3/+19
| | | | | | | | | | | | | | | | | pysideproperty has Q_ASSERT calls, which cause errors when a typename is undefined. This behavior is inconsistent and should either raise an exception or be circumvented. For compatibility with another implementation, unknown types are now ignored, and debug and release are consistent. To obtain an error, run the script with -Werrors . This makes use of the new exception delay feature. Task-number: PYSIDE-2160 Change-Id: Ia320edab4b51dd6f6b94a429b8f1f086ce9897f7 Pick-to: 6.4 6.2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Port from QSharedPointer to std::shared_ptrFriedemann Kleint2023-01-041-4/+4
| | | | | | Task-number: QTBUG-109570 Change-Id: Ieb13bf352d9b75e364a73bddc464548ec19701ed Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix QObject::sender() for non-C++ slotsFriedemann Kleint2022-12-121-2/+3
| | | | | | | | | | | | | | | For non-C++ slots routed via GlobalReceiverV2, sender() of the receiving QObject returns 0. To fix this, store the sender obtained in GlobalReceiverV2::qt_metacall() temporarily in a special dynamic property of the receiver and inject code checking it into QObject::sender(). This fixes at least the synchronous calls. Fixes: PYSIDE-2144 Fixes: PYSIDE-1295 Change-Id: Ia111162eb1404914ecfb7f19fadb8a1b63ae8b4a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Potential fix for crashing signals/disconnect_test.pyFriedemann Kleint2022-12-121-1/+14
| | | | | | | | | | Bring back the deletion loop removed by 1270a9e82e5bc3bd53a1131698ece60403da1192. Task-number: PYSIDE-2141 Change-Id: If11196d8d035eddffc1ffc22b7e1da6be8260515 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix a crash when deleting QObject instances with connections in threadsFriedemann Kleint2022-12-081-47/+36
| | | | | | | | | | | | | | | | | | | GlobalReceiverV2 connected to the destroyed() signal of the senders to keep track of its lifetime, which caused issues with delayed emission of signals when using threads. To fix this, change GlobalReceiverV2's sender list to use QPointer, which automatically tracks the lifetime of the pointees. Move the deletion of the GlobalReceiverV2 instances into SignalManager, completely, removing the "delete this" pattern used. This allows for removing some hacks for the QObject::receivers() function. Fixes: PYSIDE-2141 Change-Id: I361256f919dab13bfcf20800624b2454308bbc4b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix clazy warningsFriedemann Kleint2022-11-111-4/+4
| | | | | | | | | - Fix missing reference in for loop - Fix potential memory leak on error in SignalManager Pick-to: 6.4 Change-Id: I14819572ae250469eccac90dfbc905bf0d33c9de Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix warnings about unused parameters in codeFriedemann Kleint2022-09-261-1/+1
| | | | | | Pick-to: 6.3 6.2 Change-Id: Ie120284b290d22f2786591955465e0334555e658 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add a logging category to libpysideFriedemann Kleint2022-08-261-0/+88
| | | | | | | | | | | | | | | | | | It provides: - Debug output for Qt meta calls (useful for debugging QML applications). - Warnings, for example about dynamic slot registration caused by missing decorators. It can be enabled for example by export QT_LOGGING_RULES="qt.pyside.libpyside.warning=true". [ChangeLog][PySide6] A logging category "qt.pyside.libpyside" with warnings has been added to libpyside. Task-number: PYSIDE-2033 Change-Id: Ie972b85b8e92d2f3e2cf00efbc1047a178d95241 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Output a warning when a property metacall failsFriedemann Kleint2022-08-161-1/+5
| | | | | | Pick-to: 6.3 6.2 Change-Id: Ib435b4b87a92e859a5e1da0b54e6d442b465defc Reviewed-by: Christian Tismer <tismer@stackless.com>
* Adapt to Qt 6.4Friedemann Kleint2022-06-291-0/+1
| | | | | | Change-Id: I46f6291c1c363b1e509ef458e635f97f4423f81b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use SPDX license identifiersLucie Gérard2022-05-271-39/+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>
* 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>