aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside
Commit message (Collapse)AuthorAgeFilesLines
* type hints: Correct type signature for Property classEce Cinucen2025-04-031-4/+4
| | | | | | | | | | Task-number: PYSIDE-3012 Change-Id: I720dd730f6dd28ae33a6019494b7b67b8f704a10 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit d98400c1c7031e10e7cd03d9f2d2eb296563df67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 7cb4578076f75c728fbd28ff46e90135fb22ab1b)
* Fix connecting signals by QMetaMethodFriedemann Kleint2025-02-281-2/+4
| | | | | | | | | | | | The old implementation was calling the string-based overload, but did not add the '1'/'2' markers added by SIGNAL/SLOT. Call the QObject overload directly. Fixes: PYSIDE-1277 Change-Id: I912f46c33959b622301b0a75e771057c8874f7e3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit ad70c1a75af6cd7dbed4c43202c16e65481a2d7d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve type annotations, first stepEce Cinucen2025-02-273-17/+17
| | | | | | | | | | | Import Callable, Iterable and Sequence from collections.abc, since using them from typing is deprecated. Task-number: PYSIDE-3012 Change-Id: I131c00005df410fdaa40b338a2a728512269aaa0 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 00a5b350ec3d6f552ad0753d9c8fdbde4464d9ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Fix Slot() type annotationEce Cinucen2025-02-261-1/+1
| | | | | | | | | | The restricting type annotation for call function in Slot class is updated to more flexible one. Task-number: PYSIDE-2846 Change-Id: Ic26ebb42bb6bfe4f4d0455125ac92b3552c62d06 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 34b812b6495681d088ce3294a709f25085f6ed87) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix disconnecting a string-based connection by passing a callableFriedemann Kleint2025-02-201-2/+9
| | | | | | | | | | | | | Amends cab304e70cce68bbdaa70d7f7b2bf6e95e85e6d2. Restructure the test. Fixes: PYSIDE-3020 Task-number: PYSIDE-1057 Change-Id: I8954a534648ded5d476fec608d0699132a026461 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 96e016d95d8e37eb76492ab45dc454767ccb21b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* libpyside: Fix some clang-tidy warningsFriedemann Kleint2025-02-036-11/+9
| | | | | | | | | - Remove superfluous casts Change-Id: I8dd7cdd1e9d3f30103fc6d87bf04d7f0d0182603 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit e03a1552a701838cc616bcddaa64c8f3509c1753) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* libpyside/ PySideSignal: Reduce number of weakref handlers for sender trackingFriedemann Kleint2024-12-163-31/+58
| | | | | | | | | | | | | | | 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 Change-Id: Ic7bb836422f3843a02474f2bb92641b8a9ebc824 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit e226b5827c110d16c9d3b3f1b8d62b1c3a6e8605) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix trailing empty linesFriedemann Kleint2024-12-132-2/+0
| | | | | | | Change-Id: I1a5964463f703ade0657816cb974206355a5ae5b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit 21d8a3f57ba9136f8d181af6d5aa0ba9a5cdb8b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix occasional hang of test QtWidgets/bug_844.py on Linux with DBUS-based ↵Friedemann Kleint2024-12-091-5/+8
| | | | | | | | | | | | | | | accessibility The test installs a global event filter on QApplication which then receives events from DBUS classes doing accessibility. Then apparently something moves the DBUS receivers to different threads which causes hangs later on when PySide tries to release the wrapper. Fix by checking the presence of a wrapper first before releasing (empirical). Change-Id: I91480461afb19c8fc1fa7a329f63243c0dacb22c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 45a13791dac710a4dcbf8dfbbc6fb063bae5aed6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* libpyside: Output refcount in debug operatorsFriedemann Kleint2024-11-121-1/+7
| | | | | | | | | It is useful for leak checking. Change-Id: Ida19cb863e8232e26c86fa82a64d0d3f741b4646 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 80c677b3dd2ef3c61afb203e5ade3007c5f07e5c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* limited api: Remove PyBytes_AS_STRING and PyBytes_GET_SIZECristián Maureira-Fredes2024-11-082-3/+3
| | | | | | | | | | Remove old macros usages for the Limited API compatibility, and doing some refactorings to their usages. Change-Id: I10d675a1831d26b3fc878151e3a6ec40c5caddb1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit a9670e8cd1c56b0976adde073d71d64ef6b49b30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* limited api: Remove PyTuple_GET_ITEM, PyTuple_SET_ITEM, and PyTuple_GET_SIZE ↵Cristián Maureira-Fredes2024-11-0810-32/+31
| | | | | | | | | | | | macros Removing old macros for compatibility with the limited api, and refactoring some of their usages Change-Id: I33954199d2ef9884c64b963863b97aed851c440f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 65a9ae9a853fa68ff997edbe3d6fd4eed022f1a0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* limited api: replace PySequence_Fast_GET_SIZE by PySequence_SizeCristián Maureira-Fredes2024-11-082-2/+2
| | | | | | | | | | | | | | | | | PySequence_Fast_GET_SIZE is defined as: (PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o)) and when using the Limited API we re-define the _GET_SIZE macro to be the _Size function, and considering this is our standard use case, the macro could be replaced directly by the function. Replacing also some cases were int was used instead of Py_ssize_t when using PySequence_Size. Change-Id: I31aecd571a1d8ea82a3441f0b9e16ee19f026b05 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 57cf99afc5fcbc7608790a42471667ed6d7bdea3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* limited api: replace PySequence_Fast_GET_ITEM by PySequence_GetItemCristián Maureira-Fredes2024-11-081-2/+3
| | | | | | | | | | | | | | | | | | PySequence_Fast_GET_ITEM is defined as: (PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i)) and when using the Limited API we re-define the _GET_ITEM macro to be the _GetItem function, and considering this is our standard use case, the macro could be replaced directly by the function. However, the function returns a new reference, so we need to manually drecrease a reference after the usage, to avoid reference counting issues. Change-Id: If361e80b9e40b033e009ad46b2b9430e5b4c8eaa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit fb13a26a76eba415e743d119d5d2782c607fee2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix error handling in non-slot connection receiversFriedemann Kleint2024-10-213-0/+13
| | | | | | | | | | | | | | | | | 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.0 Task-number: PYSIDE-2810 Fixes: PYSIDE-2900 Change-Id: Ife9f156e6752dde7002218d36d369ba68ad595b0 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit e7c2b6ea1645065a64c2385498e7bd452e47c1ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* type hints: Fix typing.Callable to include parametersChristian Tismer2024-10-172-10/+14
| | | | | | | | | | | All callables have now arguments. Task-number: PYSIDE-2846 Fixes: PYSIDE-2884 Change-Id: Ibf6b1d93350304550addbc459c1440bd5cefc057 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit 7ee3fb7958d6384baf3d1bd4cfe4931cacfa77df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide6-property: Improve error handlingFriedemann Kleint2024-10-171-1/+1
| | | | | | | | | | | | PyArg_ParseTupleAndKeywords() can return Py_None for invalid types in the property decorator, for which getTypeName() returns "void". Set an error in this case. Task-number: PYSIDE-2840 Change-Id: I98a497df445d9b543dddaa495d85042e00673e78 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 9b3399ae6f35b94e2051692dc2ee9d5eea73472a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix disconnecting from C functions (qobject_connect_notify_test flakyness)v6.8.0Friedemann Kleint2024-10-092-4/+12
| | | | | | | | | | | | | | | | | | | | Callables wrapping C-function and their objects (as returned by "qobject.deleteLater()") may be temporary objects like methods. For the connection cache key, use self and the actual C-function as so that a disconnect succeeds. This did not show in the old design since the disconnect code did expensive checks to retrieve the slot index of the function and used the index code path. Amends 33bd61d13d8d9e3794b6049891be62f3351313d9. Task-number: PYSIDE-2810 Task-number: PYSIDE-2221 Change-Id: Ic33af0d5da60589df16ca35c17824da592910a4d Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit c866be38d9c14555c897a85e5b51c5e0f8347964) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Work around deprecation of PyWeakref_GetObject() in Python 3.13Friedemann Kleint2024-09-111-1/+1
| | | | | | | | Add a helper function checking on a weak reference. Task-number: PYSIDE-2751 Change-Id: I4f2d505636a24df083b0d2f4d3d312fcc44d125e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Reimplement signal connections for Python callables not targeting ↵Friedemann Kleint2024-08-219-647/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix Enum properties for Qt DesignerFriedemann Kleint2024-08-201-1/+21
| | | | | | | | | | | Split the Enum check function to have an overload for a PyTypeObject * and add a helper function checking whether an enumeration is registered in the Qt meta type system. If so, use its name for the property type. Fixes: PYSIDE-2840 Change-Id: I8253e28d9020dcda9b23d6ad5ddd4e60cd2086d7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Signal manager: Use the same signature lookup for connect/disconnectFriedemann Kleint2024-08-071-33/+34
| | | | | | | | | | | Extract a helper for matching the signal instance and use it from signalInstanceConnect() and signalInstanceDisconnect(). This currently only matters for signal QObject::destroyed(QObject*) and QObject::destroyed(). Task-number: PYSIDE-2810 Change-Id: I8ebb8487c7b6953cbfff2179c3b5081a3674bf16 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Fix QObject.disconnectNotify()Friedemann Kleint2024-08-061-2/+2
| | | | | | | | | | | | Complements 225e18558f37e2b228be5da60f27ec8186a26bc7. Just like QObject::connectNotify(), QObject.disconnectNotify() is meant to be called with the signal method. Fix it to use the signal instead of the slot. Task-number: PYSIDE-2810 Change-Id: I2b1903a2c870768760e24b903ef16499d8d5d1a5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libshiboken: Remove PepRuntime_38_flagFriedemann Kleint2024-08-061-5/+3
| | | | | | | Python 3.9 is now the minimum version. Change-Id: I7d519cf4b73516ee0d659e377805e2b6f96402d2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Use the new DynamicSlot in PySideQSlotObjectFriedemann Kleint2024-07-292-10/+11
| | | | | | Task-number: PYSIDE-2810 Change-Id: I51bd24520cc9fd420ee8256f1278bb17cd406235 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Split DynamicSlotDataV2 into separate classesFriedemann Kleint2024-07-115-149/+282
| | | | | | | | | | | | | | | | DynamicSlotDataV2 provided the callable for the slot invocation and contained switches depending on whether the callable was a method or a plain callable. Turn it into a virtual base class providing a call() method and a factory to cleanly separate the code paths for method and plain callables. Introduce an enumeration of slot types for clarity. Expose it in globalreceiverv2.h so that it can be used for PySideQSlotObject. Task-number: PYSIDE-2810 Change-Id: I4bdfb58a430c39aba2cc531c28129f71ebeb498c Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Avoid splitting/reassembling of signal/slot signaturesFriedemann Kleint2024-07-103-49/+24
| | | | | | | | | | | | 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: Prevent GlobalReceiver object creation for connections with contextsFriedemann Kleint2024-07-101-15/+1
| | | | | | | | | | This connection type always uses callables directly, no need to create GlobalReceiver instances by calling getReceiver(). Amends acab25a3ccb836818e5089b23d40196bc7414b7a. Change-Id: I3fbcaaa0495b455741a0d825f68ce6d98d2ce3aa Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Refactor signature handling in GlobalReceiverV2Friedemann Kleint2024-07-095-27/+14
| | | | | | | | | | | | 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-095-45/+74
| | | | | | | | | | | | | | 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: Avoid QByteArray construction getArgsFromSignature()Friedemann Kleint2024-07-091-9/+16
| | | | | | Task-number: PYSIDE-2810 Change-Id: I54601a5a3f1f7cd648e5e382850ee10fbe240dac Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add QMessageBox.open() with a slotFriedemann Kleint2024-07-042-0/+22
| | | | | | | | | Extract a helper function from QTimer::singleShot() implementation and use that to implement it. Fixes: PYSIDE-2805 Change-Id: Ib758d355b36c598052cfa495b53d7da423999976 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix Qt Gui applications running in interactive modeFriedemann Kleint2024-07-041-1/+40
| | | | | | | | | | Set a hook calling QCoreApplication::processEvents() unless a key is pressed to PyOS_InputHook. Fixes: PYSIDE-2192 Pick-to: 6.7 Change-Id: Ibaa16fb7e605c21c67b74609de3264ef5e4fc523 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Fix parameters for connections with contextsFriedemann Kleint2024-07-043-23/+39
| | | | | | | | | | | Use the new SignalManager::callPythonMetaMethod() overload introduced by ed8fc457e04f4ead8a3b2a2da797bdc14bd5b210 in PySideQSlotObject to convert the void ** arguments to Python. Amends acab25a3ccb836818e5089b23d40196bc7414b7a. Change-Id: I024bc7f8df7fa65b8b1761f517a99a854de2cec8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Decouple SignalManager::callPythonMetaMethod() from QMetaMethodFriedemann Kleint2024-07-042-48/+123
| | | | | | | | 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 QObject.connectNotify()Friedemann Kleint2024-07-041-2/+2
| | | | | | | | | | | | QObject::connectNotify() is meant to be called with the signal method. The code retrieved the signal method from the receiver though, potentially causing an index violation. Fix it to use the source. Remove misleading comments from 4edd9a1278efdf37f366e9aa6e82f151a357ef32. Change-Id: Id5afdde16ce002e156710128e9610804b748be74 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add warning when adding a Python-declared property failsFriedemann Kleint2024-06-271-2/+17
| | | | | | Pick-to: 6.7 Change-Id: I3b460f270965706a1b8ed04ef6f51d540db3ba72 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Add explanatory comment about methodsFriedemann Kleint2024-06-241-2/+6
| | | | | | Pick-to: 6.7 Change-Id: I0731c9c02de928dcdf268f5fc773148363b9a8fe Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Fix static analysis warningsFriedemann Kleint2024-06-2418-165/+175
| | | | | | | | | | | | | | | | - 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>
* shiboken: Fix a warning crash that is present in Python 3.13Christian Tismer2024-06-071-0/+3
| | | | | | | | | | | | This problem is new shown in Python 3.13 although this was not correct before. We need to remove the error before issuing a warning. Task-number: PYSIDE-2751 Change-Id: Ie4572e043388ca3f87092ea886e935b583f871b4 Pick-to: 6.7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyi: Fix checking errors on the property decoratorFriedemann Kleint2024-05-291-0/+1
| | | | | | | | | Add the __call__ operator. Fixes: PYSIDE-2767 Pick-to: 6.7 6.5 Change-Id: Ic73df2918fb8effaceeddbcb2c92f7ac7eb861c5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Remove short circuit signal handlingFriedemann Kleint2024-05-275-42/+15
| | | | | | | | | | | 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>
* LazyInit: Speed up QObject conversionFriedemann Kleint2024-05-211-1/+43
| | | | | | | | | | | | | | | | | | | | Lazy loading introduced a performance regression for applications using for example an event filter on QApplication, where all internal QObject-derived types from QML occur. This triggered the lazy loading mechanism for each of those classes that have no binding. To fix this, introduce checks to typeName(const QObject *) that skip the internal classes by checking for presence of a dynamic meta object and internal type names. This should also help skipping over QObject-derived classes written in Python which also have a dynamic meta object. Fixes: PYSIDE-2749 Task-number: PYSIDE-2404 Pick-to: 6.7 Change-Id: I029d104e59820fbf3dab52a3ac65b45d97b3c2e7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Remove duplicated LoadLazyClassesWithName() callFriedemann Kleint2024-05-211-7/+0
| | | | | | | | | | LoadLazyClassesWithName() is already called from getConverter(). Task-number: PYSIDE-2404 Task-number: PYSIDE-2749 Pick-to: 6.7 Change-Id: Ib3dc98e92eadbdebe247b1ae18d4e737c98b1501 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Python 3.12: Avoid issues with reference counting of immortal Python typesFriedemann Kleint2024-05-161-2/+1
| | | | | | | | | | Use the PY_RETURN_* macros for returning them. Pick-to: 6.7 6.5 Task-number: PYSIDE-2747 Change-Id: I48db8b958925e6ae39ce8ae8fb926429d0e4cd02 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Shiboken: Simplify Python Error MessagesChristian Tismer2024-05-102-38/+20
| | | | | | | | | | | | | | | | | | | The function PyErr_SetString is used quite often, which has no return value. The bracketed sequence PyErr_SetString(...); return nullptr; can in most cases be replaced by a single call to return PyErr_Format(...); To simplify matters, PyErr_Format is now used everywhere. Task-number: PYSIDE-2404 Change-Id: I5988fcd2430be700415d14d7a5cc740211e61d08 Pick-to: 6.7 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* libshiboken: Split the Shiboken::Object::newObject() functionFriedemann Kleint2024-05-061-1/+1
| | | | | | | | | | | | | | | | | | | Remove the bool exactType parameter from the existing newObject() by splitting it into 3 functions: newObjectForType() creates an instance for the type passed in. newObjectWithHeuristics() takes an additional typeName parameter obtained from typeid().name() on the C++ pointer which may contain the derived class name and also tries to find the most derived class using the type discovery graph. newObjectForPointer() is new and contains a test for multiple inheritance in the inheritance tree (disabling use of the most derived class) which was previously generated into the code. Change-Id: Ic0a25f8ec17dc20364b37062de6f20544cd2f09e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Enable supressing warnings about signal disconnection failureFriedemann Kleint2024-04-301-2/+2
| | | | | | | | | | Use PyExc_RuntimeWarning instead of PyExc_RuntimeError. Amends d7aa15abe25bd71ea19180743ce9b41e0b788520. Fixes: PYSIDE-2705 Pick-to: 6.7 Change-Id: I04de3eb92468b996e50270b2268e08b3b819e802 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>