Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libshiboken: Add utility class for stashing Python errorsFriedemann Kleint3 days1-7/+8
| | | | | | | | | It encapsulates fetching/restoring errors and uses the old or new exception API depending on version. Task-number: PYSIDE-3067 Change-Id: I6e39d92c7e79fed864b364a90c5bd5b474a41ed6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Port to Qt include styleFriedemann Kleint2025-03-279-19/+19
| | | | | | | | | Replace the Qt forwarding headers by the .h files. This brings down the dependency list by approx 6%. Pick-to: 6.9 Change-Id: Iae7640ccbdf6a8be68137922d4191522d914d790 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix includes of libshibokenFriedemann Kleint2025-03-267-12/+25
| | | | | | | | | Remove the global header <shiboken.h> in favor of the respective headers. Pick-to: 6.9 Change-Id: I08ee39fbd5abb15741fa5746bb82f9ddcd32ed7f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Improve type annotations, first stepEce Cinucen2025-02-271-4/+4
| | | | | | | | | | Import Callable, Iterable and Sequence from collections.abc, since using them from typing is deprecated. Pick-to: 6.8 Task-number: PYSIDE-3012 Change-Id: I131c00005df410fdaa40b338a2a728512269aaa0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build system: Explicitly find private modules in librariesFriedemann Kleint2025-01-271-0/+2
| | | | | | | | | | In preparation for a change that might remove the automatic finding of private modules. Task-number: PYSIDE-2862 Task-number: QTBUG-87776 Change-Id: I22f872d341b20a3f39aa722ee83c2a7993661710 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* limited api: Remove PyTuple_GET_ITEM, PyTuple_SET_ITEM, and PyTuple_GET_SIZE ↵Cristián Maureira-Fredes2024-11-084-14/+14
| | | | | | | | | | | 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>
* type hints: Fix typing.Callable to include parametersChristian Tismer2024-10-171-2/+5
| | | | | | | | | | All callables have now arguments. Task-number: PYSIDE-2846 Fixes: PYSIDE-2884 Change-Id: Ibf6b1d93350304550addbc459c1440bd5cefc057 Pick-to: 6.8 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpysideqml: Fix MSVC lossy integer conversion warning in QML error handlingFriedemann Kleint2024-09-101-4/+6
| | | | | | | | | | Returning the qint64 result of the QV4::ExecutionEngine::throw...() functions (usually 0) as int causes a lossy conversion warning. It is not clear what the original intent of the code was; return -1 instead to terminate processing in qt_metacall(), from which it is used. Change-Id: I3a4f7f38ae6f2b36de47f7d14f6c12254f85147d Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpysideqml: Fix static analysis warningsFriedemann Kleint2024-06-246-19/+21
| | | | | | | | | | | - Initialize variables - Use auto * - Use nullptr - Remove repeated return types - Minor cleanups Change-Id: I26cacce81a4c8ebc885f8c34d59fdac5d0026af9 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Shiboken: Simplify Python Error MessagesChristian Tismer2024-05-101-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* Fix class hierarchies not working with legacy qmlRegisterType()Friedemann Kleint2024-05-023-14/+47
| | | | | | | | | | | | | | | | | | | In order to work with the new QML registration code, the legacy qmlRegisterType() function set QMetaClassInfo items on the meta object of the QObject type to be registered. This caused the meta object to be recreated in PySide's dynamic meta object builder, breaking the class inheritance information. To fix this, use a separate dummy meta object to provide the information. Amends 91bf9aa10faad14de557136664f58005c935d11c. Pick-to: 6.7 Fixes: PYSIDE-2709 Change-Id: Icbd56759279bc8fcf89705af013db560babe4065 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide: Fix QML ListPropertyShyamnath Premnadh2024-04-301-1/+1
| | | | | | | | | | | | - fix broken propListCount() by changing the type of the returned value to qsizetype. Amends f9662f9b4008f683d02c829ea59676a2cf49b2fb. - Add tests to test all the ListProperty features. - Fixes some flake8 errors. Pick-to: 6.2 6.5 6.6 6.7 Task-number: PYSIDE-2698 Change-Id: I356e8af3af965374441f287391dcab9d724b28f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Replace <QtCore/QtGlobal> by respective smaller headersFriedemann Kleint2024-01-257-12/+3
| | | | | | | Task-number: QTBUG-99313 Task-number: QTBUG-97601 Change-Id: I2422a995d73f19e385c73d54410004f7b8f9d77b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Fix build with namespaced QtFriedemann Kleint2024-01-241-1/+4
| | | | | | | Task-number: PYSIDE-2590 Pick-to: 6.6 6.5 Change-Id: I977d3d93b4f8385329e154a493a12d24ee0ac196 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Use PyType_GetSlot() instead of accessing PyTypeObject's slots in library codeFriedemann Kleint2024-01-161-1/+2
| | | | | | | | | | 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>
* 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>
* Add static create() function for decorated QML singletonsFriedemann Kleint2023-11-091-5/+39
| | | | | | | | | | | | | Check for static method named "create()" and use that as a singleton creation callback. [ChangeLog][PySide6] It is now possible to use a static method create(engine) for creating decorated QML singletons. Fixes: PYSIDE-2432 Change-Id: I76c47385a0064733a1949a30d22cc01c280d0423 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Introduce a callback functor for QML singleton creationFriedemann Kleint2023-11-051-41/+109
| | | | | | | | | | | | | | | Add a functor class with shared data that keeps a reference to an object. Preparing for handling a static create() function as a singleton creation callback, this allows for clean separation of the object to keep the reference and the object to be called and provides a way of cleaning up. The cleanup cannot be currently activated since QML registration data are kept in global variables. Task-number: PYSIDE-2432 Pick-to: 6.6 Change-Id: Id57811316e8803638ac3148fdad18a854be99cca Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Improve the error handling of the QML singleton creationFriedemann Kleint2023-11-011-5/+17
| | | | | | | | | | Make the error messages more verbose and add additional checks. Move the INCREF out of the check function. Task-number: PYSIDE-2432 Pick-to: 6.6 Change-Id: I60e4ad90685f9a1a013aafb5b68503fcc59cec7d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix C-assert in qmlRegisterType()/QmlSingleton when passing non-QObject (3.12)Friedemann Kleint2023-10-271-2/+6
| | | | | | | | | | Do the check for QObject before setting the QClassInfo. Amends 91bf9aa10faad14de557136664f58005c935d11c. Task-number: PYSIDE-2484 Task-number: PYSIDE-2230 Change-Id: I3db5244360e8498c8c0e322302446b1b3f1ccd2a Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Unify the structure of type creation functionsChristian Tismer2023-10-251-18/+20
| | | | | | | | | | | | | | | | 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>
* libpysideqml: Fix C++ version propertyFriedemann Kleint2023-10-241-1/+1
| | | | | | | | | Amends 862948599999e4e5701452a3f479182606e16a89. Task-number: PYSIDE-1709 Pick-to: 6.6 6.5 Change-Id: I1b01f088cbcb99f0c7ac60324bbd98dc4c52f6b0 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* libpysideqml: Fix non-Unity buildFriedemann Kleint2023-10-241-1/+1
| | | | | | | | | Amends 91bf9aa10faad14de557136664f58005c935d11c. Task-number: PYSIDE-2484 Change-Id: I0c2abd65d97eb34f9c11a585e00d3ac2abd695b4 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* QML registration code: ModernizeFriedemann Kleint2023-10-236-132/+235
| | | | | | | | | | | | | | | Use QQmlPrivate::RegisterTypeAndRevisions and information set as QMetaClassInfo as recommended by QML team. The only remaining old code path is for qmlRegisterSingletonType() for the hypothetical case of a value type. [ChangeLog][PySide6] QML type registration has been ported to use RegisterTypeAndRevisions. Fixes: PYSIDE-2484 Change-Id: I7134cbfe1fad1fb543a560cc13b68327b9bd9c2b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QML registration code: Unify checks for QObject inheritanceFriedemann Kleint2023-10-231-9/+4
| | | | | | Task-number: PYSIDE-2484 Change-Id: Idc006c7c355be5e2f740837ee56b12d64d21f477 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QML registration code: Introduce a struct for import dataFriedemann Kleint2023-10-231-36/+82
| | | | | | | | Reduces the function parameter count. Task-number: PYSIDE-2484 Change-Id: I53b243ae90600c548a35f5362b47f623c37d9f3f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QML registration code: Port from std::string to QByteArrayFriedemann Kleint2023-10-235-50/+40
| | | | | | | | | | | | 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>
* Support running PySide on Python 3.12, QML bugChristian Tismer2023-10-171-2/+7
| | | | | | | | | | | An old thinking error was found that caused too late deletion of an object. Note: The AutoDecref construct should never be used in a static context. Task-number: PYSIDE-2230 Change-Id: If6519014f564ed86ee95bd45e14ba4821274aea6 Pick-to: 6.2 6.5 6.6 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Fix crash of test registersingletontype.py in Qt 6.7Friedemann Kleint2023-10-021-49/+58
| | | | | | | | | | | | | | | | | In f3f8939f347370dbd2738ecb536543bf8cff4a09, a second occurrence of QQmlPrivate::RegisterSingletonType in qmlRegisterSingletonInstance() was overlooked. Take the opportunity to brace-initialize the QML register structs such that further additions to them will then show up as warnings or errors. Pick-to: 6.6 6.5 6.2 Task-number: PYSIDE-2433 Change-Id: Ia2af115193531543522d427764e70130339af007 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix crashes related to enums in QML singletonsFriedemann Kleint2023-08-241-0/+2
| | | | | | | | | | Initialize missing members of QQmlPrivate::RegisterSingletonType. Pick-to: 6.5 6.2 Fixes: PYSIDE-2433 Change-Id: I441951e79471707129d42e21d27c4de352b0d703 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add support for QQmlComponent in PropertyCristián Maureira-Fredes2023-08-101-0/+2
| | | | | | | | Fixes: PYSIDE-2415 Pick-to: 6.5 6.2 Change-Id: I2b19b20b1dec584667fa82abe6be2901b9580f96 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* PySide6: Enable basic property arguments for QmlListPropertyFriedemann Kleint2023-05-031-3/+24
| | | | | | | Pick-to: 6.5 Task-number: PYSIDE-2206 Change-Id: Ia26104fba75cdba3e4d84e6fcfbffc94e4bfd3d7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* CMakeLists.txt: Add header filesFriedemann Kleint2023-03-011-16/+17
| | | | | | | | | Hoping this will help the Qt Creator code completion. Change-Id: I0777f5c38e37d560cfc1942b8acd5c76c8d64d25 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add license headers to cmake filesFriedemann Kleint2023-02-161-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Task-number: QTBUG-105718 Task-number: QTBUG-88621 Change-Id: I98bd2e80f182d8bf7aef6b633f37a428e2dac69b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* PySide6: Port from QSharedPointer to std::shared_ptrFriedemann Kleint2023-01-047-13/+13
| | | | | | Task-number: QTBUG-109570 Change-Id: Ieb13bf352d9b75e364a73bddc464548ec19701ed Reviewed-by: Christian Tismer <tismer@stackless.com>
* Build system: Add an option to enable CMake UNITY_BUILD (jumbo) buildsFriedemann Kleint2022-12-191-0/+5
| | | | | | | | | | [ChangeLog] An option --unity has been added to setup.py enabling enabling CMake UNITY_BUILD (jumbo) builds, which speeds up building. Fixes: PYSIDE-2155 Change-Id: I235a18335d6070bc3eb4ea7f9953925f6d9e174c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide6: Fix CMake UNITY_BUILD (jumbo) builds of the librariesFriedemann Kleint2022-12-162-2/+4
| | | | | | | | | Prevent clashes of the slots keyword and rename duplicated static variables. Task-number: PYSIDE-2155 Change-Id: I68fd004a595d7ed21f23c71d6635441aba85fd60 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside/libpysideqml: Update list of headers to be installedFriedemann Kleint2022-11-161-1/+11
| | | | | | | | Task-number: PYSIDE-802 Task-number: PYSIDE-962 Pick-to: 6.4 Change-Id: I6a9ea15a89630453600b44b3f22d2944f047622b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* build: drop the version from the installed cmake directoryCristián Maureira-Fredes2022-10-121-5/+5
| | | | | | | | | | | | | | | | | | | | This will replace the structure of installed cmake directories, for example: cmake/PySide6-6.2.4/PySide6Config.cmake to cmake/PySide6/PySide6Config.cmake Shiboken files under the cmake/ directory are affected as well. [ChangeLog][pyside6] the version was drop from the cmake installed directory. Fixes: PYSIDE-2009 Change-Id: I778063a615f123e4398f8d776704302465cd0b76 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix build error on Windows caused by macro copysign in CPythonFriedemann Kleint2022-08-011-0/+6
| | | | | | | | | | Remove the define, fixing: qjsprimitivevalue.h(805): error C2039: '_copysign': is not a member of 'std' Pick-to: 6.3 6.2 Change-Id: Iad9b467decc81a3eed534f49d26e30237eef23de Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Build with lean Qt headersFriedemann Kleint2022-06-291-0/+2
| | | | | | | | | This should speed up compilation time. Task-number: QTBUG-97601 Change-Id: Ibd25739dfe5032113ff9c1df5ff5da4cf9effc2d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Adapt to Qt 6.4Friedemann Kleint2022-06-291-3/+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-2723-874/+46
| | | | | | | | | | | 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>
* Fix include conventionsFriedemann Kleint2022-04-221-1/+1
| | | | | | | | | Reorder includes such that local includes are first, followed by Qt and C/C++ system includes. Pick-to: 6.3 6.2 Change-Id: Ib801d34de7242befce4be429bfb099ccabe1f987 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QPyQmlParserStatusFriedemann Kleint2022-04-011-6/+20
| | | | | | | | | [ChangeLog][PySide6] class QPyQmlParserStatus for handling QML parser status changes has been added. Fixes: PYSIDE-1876 Change-Id: Ic1066924ec85dc8633f959342921c1d03da1aee4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Strip libraries in release modeFriedemann Kleint2022-03-141-0/+2
| | | | | | | | | [ChangeLog][PySide6] Libraries are now stripped. Task-number: PYSIDE-661 Change-Id: I20ea056b8e91cca917017afa62811208c297d51d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide6: Fix properties of type QQmlPropertyMap *Friedemann Kleint2022-03-101-0/+4
| | | | | | | | | Add a call to qRegisterMetaType(). Pick-to: 6.2 Fixes: PYSIDE-1845 Change-Id: I25df264fc13dc515cd6035df8e0b608a7dabaa74 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpysideqml: Fix size of QObjectFriedemann Kleint2022-03-041-4/+2
| | | | | | | | | | | Simply use int(sizeof(QObject)). The original code was written with a cross-build mindset, but libpysideqml is built on the target. Amends f017d4abe8199e203a5e625738d312932804601d. Task-number: PYSIDE-1709 Change-Id: Ie003b7a4733050d5bcd3f895d436bc0eb8c3bff1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Simplify special code handling Qt Quick type registrationFriedemann Kleint2022-03-032-46/+39
| | | | | | | | | | | | | | | | | The code used templates to ensure the QMetaTypes registered in QML matched the Qt Quick types (QQuickPaintedItem, QQuickFramebufferObject, QQuickItem). After fixing the metatypes, all that is left is to determine the correct values for QQmlPrivate::RegisterType::parserStatusCast, valueSourceCast and valueInterceptorCast by the template code. This will make the QmlAttached/QmlExtended work with Qt Quick, too. Task-number: PYSIDE-1836 Change-Id: Ic31587c9fd2dca46f6957757079b6abc56cc7416 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix grouped QML propertiesFriedemann Kleint2022-03-031-3/+10
| | | | | | | | | | | | | 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>