Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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: Fix static analysis warningsFriedemann Kleint2024-06-241-12/+12
| | | | | | | | | | | | | | | | - 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>
* Use PyType_GetSlot() instead of accessing PyTypeObject's slots in library codeFriedemann Kleint2024-01-161-1/+1
| | | | | | | | | | 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>
* libpyside: Implement QMetaMethod::tags() for @SlotFriedemann Kleint2023-10-171-3/+7
| | | | | | | | | | | | | Tags can be used like annotations and are for example used in the DBus module. [ChangeLog][PySide6] An optional parameter "tag" has been added to @Slot, allowing to set QMetaMethod.tag(). Pick-to: 6.6 Fixes: PYSIDE-748 Change-Id: I62bef6179917307471cb72491ac3d05970572f3f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Get rid of tp_dict in generalChristian Tismer2023-10-091-2/+4
| | | | | | | | | | | | | | It is a long due task to finally remove the direct access to type object fields. With Python 3.12, direct access to tp_dict became problematic. We use that as a reason to start removing the direct access in favor of function calls. Task-number: PYSIDE-2230 Change-Id: I6f8a7479ab0afdbef14d4661f66c3588f3a578aa Pick-to: 6.2 6.5 6.6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Replace QPair by std::pairFriedemann Kleint2023-09-291-3/+2
| | | | | | Pick-to: 6.6 6.5 Change-Id: Ic64a2a2c162c54fbbfb6ddc5004ffe1944bfd37a Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Avoid some string conversionsFriedemann Kleint2023-09-271-2/+3
| | | | | | | | | Remove some usages of String::toCString(func_name) and construction of a QByteArray. Pick-to: 6.6 6.5 Change-Id: I9fb29341fba1be205e70d8d5ffc1a6d258ef87dd Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libshiboken/libpyside: Fix some static analysis warningsFriedemann Kleint2023-09-201-2/+2
| | | | | | | | | | | | - nullptr - narrowing integer conversions - else after return - Use auto - Missing move special functions Pick-to: 6.6 6.5 Change-Id: Ib872481a46c8bb17592cdc1778ab3c4d9598c753 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide6: Strictly check the argument names argument to SignalFriedemann Kleint2023-09-051-2/+2
| | | | | | | | | | | | | | | Accept only lists and tuples of strings as argument names, preventing crashes when passing numbers or strings being split into characters by the sequence check. As a drive-by change PySideSignalData::signalArguments from QByteArrayList* to QByteArrayList which eases error handling. As it is a shared class anyways, the overhead is negligible. Task-number: PYSIDE-2368 Change-Id: I460b5d7297cf66c6ab5566a99c998527daf12eed Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* libpyside: Refactor passing slot data between @Slot and MetaObjectBuilderFriedemann Kleint2023-09-051-19/+9
| | | | | | | | | | | | | | | The slot data required for MetaObjectBuilder were stored in a PyList set as an attribute on a method. This required concatenating return type and signature, converting the resulting string to CPython in the @Slot code and converting it back to QByteArray in MetaObjectBuilder. To simplify this, introduce a small C++ struct storing the QByteArrays and store a list of them as a PyCapsule (encapsulating a void *ptr) which is used as the attribute value. Task-number: PYSIDE-748 Change-Id: I7f4075f5e828fe543d01e5dfbdc7087905cd004f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Use a static string for the slot attribute attached to methodsFriedemann Kleint2023-08-301-1/+2
| | | | | | Task-number: PYSIDE-748 Change-Id: Ieeeb2c1c392706a5c74bf29ff67ff4ddd8c4feaa Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@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>
* libpyside: Refactor handling of named signal argumentsFriedemann Kleint2022-03-141-10/+8
| | | | | | | | | Allocate the list of names only if the "arguments" parameter is present. Delete it in signalFree(). Pick-to: 6.2 Change-Id: I56fe3c1a50a73e7a7ae924ccb844d2bd6378a00d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix grouped QML propertiesFriedemann Kleint2022-03-031-7/+37
| | | | | | | | | | | | | Register the meta type using QQmlMetaTypeInterface and use them when creating properties in the dynamic metaobject builder. This at least fixes grouped properties when decorators are used. It does not work when using plain qmlRegisterType() due to an ordering problem. Fixes: PYSIDE-1836 Change-Id: I06db020a1ccd169da7a745cc5ef42d38ce35f5f5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Remove unused dynamicqmetaobject_p.hFriedemann Kleint2022-01-071-1/+0
| | | | | Change-Id: I4aef7765fc2647cd597fb316535fe28dc43cef01 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add a __repr__ function for QMetaObjectFriedemann Kleint2022-01-061-0/+101
| | | | | | | | This is helpful for QML debugging. Task-number: PYSIDE-1709 Change-Id: If9baeb5a52999c4718e951f0ea5736783a9fcbff Reviewed-by: Christian Tismer <tismer@stackless.com>
* 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>
* Define SbkObjectType to be a PyTypeObjectFriedemann Kleint2021-09-111-1/+1
| | | | | | | | | | | | | | | SbkObjectType was a struct embedding a PyTypeObject after fec1611e9f42c1f0a13eb33474df2ed8ee480842. Remove that and make the types equvivalent, which allows for removing many reinterpret_casts. SbkObjectType is left as a typedef for client code snippets. [ChangeLog][shiboken6] SbkObjectType is now a typedef for PyTypeObject. Task-number: PYSIDE-535 Change-Id: I44812311ccbbe0988c38e34c47d16f6874f8d1cf Reviewed-by: Christian Tismer <tismer@stackless.com>
* Implement qmlRegisterSingletonInstanceCristián Maureira-Fredes2021-08-171-2/+2
| | | | | | | | | | | | Using a similar approach to the qmlRegisterSingletonType, but wrapping the instance (QObject) into a SingletonFunctor as described in Qt/C++. Add helper function PySide::isQObjectDerived Task-number: PYSIDE-487 Change-Id: Id0fd9da0351a9ba58eae006d7d882f9815f06742 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Shiboken: Remove cheating macrosChristian Tismer2021-08-061-1/+1
| | | | | | | | | | | | | | | There are a number of cheating macros that allow to use the same code in Python 2 and 3. Because Python 2 is gone, remove these macros. This conversion was partially difficult since certain types collapsed in the XML files and generated functions contained substrings of the macros. This is actually the fourth attempt. Task-number: PYSIDE-1019 Pick-to: 6.1 Change-Id: I116877afc8aa36f4710a40df1769f600b6b750ea Reviewed-by: Christian Tismer <tismer@stackless.com>
* Replace QVector by QListFriedemann Kleint2020-11-251-9/+7
| | | | | | | | | | | | | | | | Change AbstractMetaClass::templateArguments() to return TypeEntries (const TypeEntry *) instead non-const. Remove redundant typedef OverloadData::MetaFunctionList. Use existing typedefs in some places. Add new typedefs for MetaObjectBuilder::EnumValues and AbstractMetaFunctionCList. Change-Id: Ia241b5fbe54d60ea57175fb1f6c844604e066a3d Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-021-0/+588
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>