aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Debug operators: Fix handling of longs exceeding long long maxFriedemann Kleint2024-03-261-3/+9
| | | | | | | | | | Use PyLong_AsUnsignedLongLong if an overflow occurs. Use hex for those large values. Task-number: PYSIDE-2652 Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I9c3404cf8b01b1fcda20516c1105797fc512ed53 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Clean up lambdas connected to signals earlier in shutdownFriedemann Kleint2024-03-252-1/+21
| | | | | | | | | | | 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-253-10/+10
| | | | | | | | | | 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: Add a debug operator for a Py_BufferFriedemann Kleint2024-03-142-1/+52
| | | | | | Task-number: PYSIDE-2628 Change-Id: I34646f76f509ec30e3d63fc8df296d2b5692ff0e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* LazyInit: Implement Lazy Initialization by Delayed Module EntriesChristian Tismer2024-03-131-0/+8
| | | | | | | | | | | | | | | | | | | | Lazy init is done by module entries which are delayed. Although visible in the module, the classes are only created when actually accessed by getattr. Internally, the access to the global Init_xxx functions is redirected to a Shiboken::Module::get function which resolves the classes if not already present in the global type array. PYSIDE6_OPTION_LAZY 0 - no lazy loading 1 - lazy load all known modules 2 - lazy load all modules Task-number: PYSIDE-2404 Change-Id: I98c01856e293732c166662050d0fbc6f6ec9082b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* 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>
* Add QIOPipeAdrian Herrmann2024-03-131-2/+2
| | | | | | | | | | | | Add an implementation for a QIODevice that can be used to work with anonymous pipes. It needs to be able to emit the bytesWritten and readyRead signals. This implementation is lifted from the qt5 source tree (qtdeclarative/tests/auto/qmlls/lifecycle) and might be added to Qt in the future, at which point it will be removed from the PySide source tree. Change-Id: Iff1208a366dad747352e7507da0818934c26aa4f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Feature: Prepare feature and signature modules to stand lazy initChristian Tismer2024-03-053-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | When lazy initialization is used, unexpected situations are coming up. The feature switching may call into signature init without knowledge that feature dicts are already switched. Fix this by - disabling feature switching during lazy init of a class - allow this disabling from PySide and Shiboken - Create a way to find the unchanged type dict of features UPDATE: Switching speed is now as high as before. This check-in was extracted after the fact, although it claims to exist beforehand which would have been better. This was quite a painful experience. Change-Id: I6639b7a3c22d21d3b9dd0627e2880a7b7a03d134 Task-number: PYSIDE-1019 Task-number: PYSIDE-2404 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use new comparison helpers for equality in shiboken/libpysideFriedemann Kleint2024-03-011-10/+7
| | | | | | | | | Task-number: QTBUG-103757 Task-number: PYSIDE-2497 Change-Id: I1b0fd5b1cad908ee612ab33ca0aacffc55947d87 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* 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>
* QObject: Add connect() overload with context argAdrian Herrmann2024-02-075-0/+127
| | | | | | | | | | | On C++, there is an overload of QObject::connect() that allows passing a context object. This creates a connection in the context object's event loop instead of that of the caller. This implements said overload in Python. Pick-to: 6.6 Change-Id: Ia6a098a04470741efd450818c31aa5bffb1bd9f8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Replace <QtCore/QtGlobal> by respective smaller headersFriedemann Kleint2024-01-254-4/+6
| | | | | | | Task-number: QTBUG-99313 Task-number: QTBUG-97601 Change-Id: I2422a995d73f19e385c73d54410004f7b8f9d77b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix debug assert in test signals/bug_189.pyFriedemann Kleint2024-01-181-2/+7
| | | | | | | | | | | Do not use the %S-formatting directive when an error is already set, since that will invoke str() and thus cause an error. Amends d7aa15abe25bd71ea19180743ce9b41e0b788520. Task-number: PYSIDE-1275 Change-Id: I1125ca254efdeeb3652d6171d71f3e22fb686a7a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Change QObject.disconnect() to return False with warning on failureFriedemann Kleint2024-01-161-7/+13
| | | | | | | | | | [ChangeLog][PySide6] QObject.disconnect() now returns False instead of raising an exception for non-fatal cases. Fixes: PYSIDE-1275 Change-Id: I860b69e1a7055c38f903ffafd7f816575c0d1f7a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use PyType_GetSlot() instead of accessing PyTypeObject's slots in library codeFriedemann Kleint2024-01-166-20/+23
| | | | | | | | | | Using PepType_GetSlot() as is requires adding ugly casts. To work around, add a new file with convenience helper functions in C++ linkage. This also allows for using templates for tp_alloc. Task-number: PYSIDE-560 Change-Id: Ia50a226f5b545861f885d600445b91b4e11713c5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Avoid converting to string for calculating the hash valueFriedemann Kleint2023-12-191-1/+1
| | | | | | | | | | | | | | | Partially revert bf8a60db4cdbfc3e7c9c98778b219e9c83746d44, which introduced a helper function converting to QString for Q(Date)(Time) and QUrl. For these classes, the qHash() function should be found by the code model after 9c37876d6f649b3c9bd1411d3c7ffe620786f1a8. Extend the test accordingly. Deprecate the QString-helper. Task-number: PYSIDE-1906 Change-Id: Ia210a2210bc6a43991d5b26374039f4e86d0e71e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Modernize qHash functions preparing introduction of Qt's comparison helpersFriedemann Kleint2023-12-192-11/+6
| | | | | | | | | Use qHashMulti, noexcept and make them inline friends. As a drive-by, also make comparison for Clang structures noexcept. Pick-to: 6.6 Change-Id: Ibdcbf3bde90af0fc419bd1640d3f45602f772f9a Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PEP 697: Use the new type extension provisionChristian Tismer2023-12-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | By Python 3.12, there is now an official way to extend heap types by custom extra data. When we supported PyPy, the old type extension of PySide did no longer work, and we introduced shadow dicts. With the interface found in Python 3.12, we can use direct extended data, again. The supporting structures are not Limited API compatible. We implemented a patch that enables this anyway, but it is valid for this version only without a new review. NOTE: The documentation lists `PyObject_GetTypeData` as Limited API since Version 3.12, but in fact we had to write a cheating patch. [ChangeLog][PySide6] Hidden Type Extensions according to PEP 697 are now used instead of shadow dictionaries. Change-Id: I4b724ba7bcc72470b13f55ea5ebf94666061420d Task-number: PYSIDE-2230 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix usages of QLatin1String (deprecation candidate)Friedemann Kleint2023-11-291-1/+1
| | | | | | | | | Use QLatin1StringView or literals. Task-number: PYSIDE-2537 Change-Id: I03cb9ae80dacd84da9e53648dd179ad79e9189b1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Enable connecting signals to slots with default parametersFriedemann Kleint2023-11-291-8/+27
| | | | | | | | | | | | | | | Find the number of default parameters using PyFunction_GetDefaults() and change the argCount() helper to return the min/max argument count. With that, try to match the slot using the most argument. [ChangeLog][PySide6] It is now possible to connect signals to slots/lambdas with more arguments provided they have default parameters. Fixes: PYSIDE-2524 Change-Id: I134d33e3ee78b62689fa36887a9acd41951c02e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Remove QHash used when adding signals from QMetaObjectFriedemann Kleint2023-11-281-10/+19
| | | | | | | | | Replace it by a list. Task-number: PYSIDE-2524 Change-Id: I16089a2f53f10726377f4ed66bc466549f4f6474 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Avoid parsing signatures in Signal.connect()Friedemann Kleint2023-11-282-24/+23
| | | | | | | | | | | Store the argument count as obtained from QMetaMethod or Signal argument parsing via PySideSignalData::Signature in PySideSignalInstancePrivate and use that to find a matching slot instead of parsing the signature. Task-number: PYSIDE-2524 Change-Id: I7c30bd1ee7873b4d13c40e0a91a4ace9026890a2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpyside: Remove struct SignalSignatureFriedemann Kleint2023-11-282-76/+29
| | | | | | | | | | | | | | | | SignalSignature is temporarily used while constructing Signal instances and finally converted into a PySideSignalData::Signature. Change the code to use PySideSignalData::Signature right away, which allows simplifying the code. As a drive-by, fix the less-than method. Shorten the data type for the attributes to be able to add further values. Pick-to: 6.6 Task-number: PYSIDE-2524 Change-Id: I4b67d55b65356fbf56633bbbe1d3ef466167227c Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Shiboken: Fix an oversight when removing ob_typeChristian Tismer2023-11-201-4/+42
| | | | | | | | | | | | | | | | SbkObjectType's meta type was changed due to a wrong fix. This has strange side effects when applying PEP 697 because a wrong action is taken. The meta class for class property was also rewritten to have its own meta class for PEP 697 compatibility. Amends: 73adefe22ffbfabe0ef213e9c2fe2c56efdd7488 Change-Id: I2d5c0a58e274c0a60496e29cbd714b9e69bfffbd Pick-to: 6.6 6.5 6.2 Task-number: PYSIDE-2230 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside: Port the signal signature code from QString to QByteArrayFriedemann Kleint2023-11-164-24/+25
| | | | | | | | | | 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>
* libpyside: Fix slot names in GlobalReceiverV2Friedemann Kleint2023-11-161-0/+4
| | | | | | | | | | | Replace "<lambda>" by "_lambda_" when one is passed. Task-number: PYSIDE-2524 Pick-to: 6.6 Change-Id: I9839c5e2862fc8c0153653eff1d29cf759dc5875 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Set error when instantiating a Signal on a non-QObjectFriedemann Kleint2023-10-271-1/+2
| | | | | | | Fixes: PYSIDE-2510 Pick-to: 6.6 6.5 Change-Id: Icc1461299907cc116bc75f5de994a687b85c1786 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Fix signature of SignalInstance.connect()Friedemann Kleint2023-10-271-1/+3
| | | | | | | | | | Amends 7878a88aa638da63b8a2ec2200bbe18882277d21. Pick-to: 6.6 6.5 Fixes: PYSIDE-2509 Task-number: PYSIDE-1334 Change-Id: I92fc4021054b1473bd6769ffb9ff0e6803b5439e Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* PEP 697: Introduce the SbkObjectType_Check functionChristian Tismer2023-10-251-0/+2
| | | | | | | | | | | | | | | By Python 3.12, there is now an official way to extend heap types by custom extra data. In order to make that most effective, we can no longer accept every type in PepType_SOTP, but keep the types carefully apart. This is done with SbkObjectType_Check, which is very rarely necessary. Change-Id: I9cc4b594f2f676712ba92bf7733c4321b717f252 Pick-to: 6.6 Task-number: PYSIDE-2230 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Unify the structure of type creation functionsChristian Tismer2023-10-256-146/+182
| | | | | | | | | | | | | | | | It is the better concept to use the same structure for all type creation functions. We move the type slots and type specs into these functions. The calling function then always has the same structure of one static expression and returning the type. This might also save some space for shatic structures. Task-number: PYSIDE-2230 Change-Id: Ib972f210f44422eb1ebe47a0d92ac18a8377ac87 Pick-to: 6.6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix threading deadlocks of QObject::(dis)connect() with (dis)connectNotify()Friedemann Kleint2023-10-241-2/+9
| | | | | | | | | Do the connect/disconnect within allow-threads. Fixes: PYSIDE-2367 Pick-to: 6.6 6.5 Change-Id: I95c908d438a4a6c9cd0a23d3fce31a53e02ea19d Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* QML registration code: Port from std::string to QByteArrayFriedemann Kleint2023-10-232-5/+5
| | | | | | | | | | | | Modern QML registration code is based on QMetaClassInfo, which uses QByteArray; so, this will avoid conversions in the future. As a drive-by, shorten some code and move getGlobal*() helpers to the top for future changes. Task-number: PYSIDE-2484 Change-Id: Iceadca5a42b5fb7cee330e61d543ca712b521ab3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QML registration code: Extract a setter from the ClassInfo decoratorFriedemann Kleint2023-10-233-25/+55
| | | | | | | | | | | | | Change it to operate on a list of key/value pairs instead of a QMap (no use in enforcing sorting) and extract a setter for setting QMetaClassInfo data on a PyTypeObject of a QObject. To be used for QML decorators. As a drive-by, fix some static analysis warnings about implicit bool casts. Task-number: PYSIDE-2484 Change-Id: Ia759bb42740ed279f36c0850306ebd9bee526ecf Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>