aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtQml
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.12: Avoid issues with reference counting of immortal Python typesFriedemann Kleint2024-05-161-1/+4
| | | | | | | | | | 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>
* Documentation: Add more doc file hints for QML functionsFriedemann Kleint2024-05-131-3/+6
| | | | | | | | | Complements ad5eb64daaaa1b927bcbf9e568738f417fef845f. Pick-to: 6.7 Task-number: PYSIDE-1106 Change-Id: I0ae554db3be02d6160e7e00af46f21ff0a34cca8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Shiboken: Simplify Python Error MessagesChristian Tismer2024-05-101-4/+2
| | | | | | | | | | | | | | | | | | | 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>
* shiboken6: Add attributes for global inline namespacesFriedemann Kleint2024-04-081-1/+2
| | | | | | | Pick-to: 6.7 Fixes: PYSIDE-2590 Change-Id: I36ce25bc759cd888f80b797d4f40864c3d2e2a84 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Build system: Clean Qt libraries linked by the modulesFriedemann Kleint2024-04-041-2/+0
| | | | | | | | | | | | | | Only the bound Qt library needs to be linked, it will bring its dependencies. Add explanatory comment for the exceptions (QtTest, QtSql). Pick-to: 6.7 Task-number: PYSIDE-2649 Change-Id: Ib84d37248578a76400d307bb5d050005110677c3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use PyType_GetSlot() instead of accessing PyTypeObject's slots in library codeFriedemann Kleint2024-01-161-2/+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>
* PySide6: Add QQmlEgine.singletonInstance()Friedemann Kleint2024-01-091-0/+24
| | | | | | | | | [ChangeLog][PySide6] QQmlEgine.singletonInstance() has been added. Pick-to: 6.6 Change-Id: Ib1b48df49ca8a183dba415a04f414903f58e435c Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Document QtQml's global function as functionsFriedemann Kleint2023-12-211-0/+12
| | | | | | | | | | | Replace the extra documents (which get generated into the class list) by function documentation snippets, so that they show up correctly under "Global functions". Task-number: PYSIDE-1106 Change-Id: I6a5c457669f7f1db1f572f131721dc443a7d5c70 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add a documentation file hint to function/enum type entriesFriedemann Kleint2023-12-191-5/+5
| | | | | | Task-number: PYSIDE-1106 Change-Id: I28b3fa16f37d0d689956b55caa949307472efda6 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken: Unify the structure of type creation functionsChristian Tismer2023-10-251-16/+22
| | | | | | | | | | | | | | | | 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>
* Replace typedef by usingFriedemann Kleint2023-09-201-2/+2
| | | | | | | Pick-to: 6.6 6.5 Change-Id: I23d8ea03ec578a897352c2627417a706ca71ef82 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* PySide6: Fix signatures of the qmlRegister() functionsFriedemann Kleint2023-08-021-0/+6
| | | | | | | | | uri is str. Pick-to: 6.5 Fixes: PYSIDE-2272 Change-Id: I1e10ef65bf223b08b035c24f44bac83f0450ad14 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Enable threads for QML load methodsFriedemann Kleint2023-06-281-0/+5
| | | | | | | | Otherwise, for example QQmlAbstractUrlInterceptor locks up. Pick-to: 6.5 Change-Id: I4f1b3e1829b00c16cbf983d6f297304c0e99023f Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix typing error for QQmlExpression::evaluate(bool *v)Friedemann Kleint2023-06-201-1/+1
| | | | | | | | | | | Use Any instead of "any". Amends 3c2117c6ce31ff403fc2f17a181763057cd2e1bc. Pick-to: 6.5 Task-number: PYSIDE-2285 Fixes: PYSIDE-2364 Change-Id: I1adc6c2e8e4d12516c42ba09b9431638423af1d3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide6: Reject some internal namespacesFriedemann Kleint2023-05-121-0/+2
| | | | | | | | This reduces noise in the log files. Pick-to: 6.5 Change-Id: I0c8c98859058d9bbef26f71da83918490099a318 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add type hints for return values modified to Tuple[]Friedemann Kleint2023-04-131-3/+3
| | | | | | | Pick-to: 6.5 Fixes: PYSIDE-2285 Change-Id: I525ffea2f79bf54de43dc02c31a41994fe3004d5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Add parameter names to the qmlRegister() functionsFriedemann Kleint2023-03-301-7/+7
| | | | | | | | Pick-to: 6.5 Task-number: PYSIDE-2272 Change-Id: I8f67505875178c007de2c141a524e9bc1e76169a Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@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: Remove obsolete "since" tags from typesystemFriedemann Kleint2022-11-021-4/+4
| | | | | | Pick-to: 6.4 6.2 Change-Id: Id7f1c8923eb8612771863893ab159d3434ca5041 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-273-114/+6
| | | | | | | | | | | 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: Add QQmlContext::setContextProperties()Friedemann Kleint2022-05-092-1/+4
| | | | | | | | Pick-to: 6.3 Fixes: PYSIDE-1921 Change-Id: Id80f9c2f7533d7e2d58af0fb0f1d6d8eb586d31a Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QPyQmlParserStatusFriedemann Kleint2022-04-013-1/+6
| | | | | | | | | [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>
* Implement QQmlPropertyValueSourceFriedemann Kleint2022-02-283-1/+10
| | | | | | | | | | | | | | | As is done with the other interfaces, add a class QPyQmlPropertyValueSource inheriting from QObject and QQmlPropertyValueSource. Store its offset in QQmlPrivate::RegisterType::valueSourceCast if it is found as a base class. [ChangeLog][PySide6] class QPyQmlPropertyValueSource for implementing QML value sources for properties has been added. Task-number: PYSIDE-1709 Change-Id: Icd1bd57972f339f9839ccd8d9bf6ff9e5e16ec62 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the QmlAttached decoratorFriedemann Kleint2022-02-161-0/+6
| | | | | | | | [ChangeLog][PySide6] The QmlAttached decorator has been added. Task-number: PYSIDE-1709 Change-Id: I0301ecc7a9bc7a1b798095e8972b2fe4addf2eaf Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: Rename interface functions and classes to simplify debuggingChristian Tismer2022-02-032-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The names of certain interface functions are not always following a simple scheme. Especially it is not easy to see immediately if we are dealing with a method of SbkObjectType or SbkObject Do a few renamings to simplify debugging and make the code easier to understand. When a function is used in a type spec and there is no other important reason, it should be named like {Py_<tpname>: reinterpret_cast<void *>(<TypeName>_<tpname>)}, Rename also all type functions ending on "TypeF()" to end in "_TypeF()". This is not always the case. Examples: SbkObjectTpNew -> SbkObject_tp_new SbkObjecttypeTpNew -> SbkObjectType_tp_new PyClassPropertyTypeF -> PyClassProperty_TypeF Task-number: PYSIDE-535 Change-Id: Icbd118852f2ee732b55d944ed57c7a8ef7d26139 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Fix QQmlApplicationEngine.load(str) to not construct a QUrlFriedemann Kleint2021-12-151-2/+4
| | | | | | | | | | | | | | Specify the overload number so that string is checked first. Add a test since QQmlApplicationEngine is not yet tested. Amends 2cc81fd5e63bf931d8c9d1c8c2c66ac9e16ef087. Pick-to: 6.2 Fixes: PYSIDE-1736 Task-number: PYSIDE-1499 Change-Id: I1736928f1acf17fda5671bd11d16c5017141f1ff Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Move the QML registration code into a libraryFriedemann Kleint2021-12-0811-1406/+5
| | | | | | | | | This makes the code easier to maintain. Task-number: PYSIDE-1709 Change-Id: Idb75143a7e6d218637ab75463db88b6135cd4086 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Split up the pyside.h headerFriedemann Kleint2021-11-261-0/+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>
* libpyside6: Add a convenience function to convert a PyObject * to a QObject *Friedemann Kleint2021-11-231-8/+3
| | | | | | | Pick-to: 6.2 Task-number: PYSIDE-1709 Change-Id: I137d7fd3ac84f50bb6a799e27e07b7523d943812 Reviewed-by: Christian Tismer <tismer@stackless.com>
* pysideqmlregistertype.cpp: Fix compilation with QT_NO_CAST_FROM_ASCIIFriedemann Kleint2021-11-191-1/+1
| | | | | | | | | | Properly convert noCreationReason, preparing for moving the code into a library. Pick-to: 6.2 Task-number: PYSIDE-1709 Change-Id: I795bf0be22e192cd8abeed628e1a545429acb9cd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Fix build against Qt 6.2.1Friedemann Kleint2021-11-161-0/+1
| | | | | | | | | | | | | | Fixes: 6.2.1/gcc_64/include/QtQml/6.2.1/QtQml/private/qtqmlcompilerglobal_p.h:54:10: fatal error: QtCore/private/qglobal_p.h: No such file or directory Amends 346a4a86fc2d7064e44c0766dd08374d652cdcc1. Add an include path for the QtCore private headers. Task-number: PYSIDE-1709 Pick-to: 6.2 Change-Id: I3189d4d9fe05e038634af1d0ef7bc66c16be7aab Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add a QmlSingleton decoratorFriedemann Kleint2021-11-163-9/+40
| | | | | | | | | | Add a simple decorator function that stores the type in a list for the QmlElement decorator to use singleton registration. Task-number: PYSIDE-1709 Pick-to: 6.2 Change-Id: I075d583404bd60dc52b84c23a3d09e50d32a5a3a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add a QmlUncreatable decoratorFriedemann Kleint2021-11-155-1/+272
| | | | | | | | | | | Add a class type that stores the reason and registers the type in the call operator. This is then queried by the register type helper functions. Pick-to: 6.2 Task-number: PYSIDE-1709 Change-Id: I0dd0c4c1e05e6e0ee6f22a6947b85546fc373fb9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* PySide6: Remove QML dependency from libpysideFriedemann Kleint2021-11-114-0/+157
| | | | | | | | | | | | | | 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>
* PySide6: Remove QML includes from pyside.hFriedemann Kleint2021-11-111-2/+4
| | | | | | | | | | | Forward-declare QQmlPrivate::RegisterType. This requires adding some includes in dependent modules. [ChangeLog][PySide6] pyside.h no longer includes QML headers. Pick-to: 6.2 Change-Id: I7d7b703d46e45adbb714d817f05b5480b35d4a4c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Add a QmlAnonymous decoratorFriedemann Kleint2021-11-103-6/+42
| | | | | | | | | | Split out a helper from the qmlElementMacro() to register (also preparing for uncreatable types) and add the decorator. Pick-to: 6.2 Change-Id: I0f3ebf6f31c141083440abcc9f1acd227ce046d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Decouple pysideqmlregistertype.cpp from generated headersFriedemann Kleint2021-11-099-441/+699
| | | | | | | | | | | | | | | | | | | Split out QtQml_VolatileBoolType and QtQmlListProperty into separate files. QtQml_VolatileBoolType still requires the generated header and therefore needs to remain a static source of the QtQml module. In pysideqmlregistertype.cpp and the newly added pysideqmllistproperty.cpp, retrieve the required type objects by name lookup from libshiboken instead of accessing the arrays of the generated headers. With that, the generated headers are no no longer required and they can be moved to libpyside or another extension library at some point. Pick-to: 6.2 Change-Id: I9bbc880c58e38d8a623723d64e56b16574a1eb86 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Add a __repr__ method for QQmlErrorFriedemann Kleint2021-11-051-1/+5
| | | | | | | | This is handy for debugging QML. Pick-to: 6.2 Change-Id: Ic9c98a27377416debaa41ab1f95b3b10db4f143d Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Add qmlRegister functions taking a library URLFriedemann Kleint2021-10-111-0/+2
| | | | | | | Fixes: PYSIDE-1631 Pick-to: 6.2 Change-Id: I082c3576c24f772190cc103da787311b43acf88c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Fix hang in QQmlApplicationEngine functions with message handlerFriedemann Kleint2021-10-071-1/+6
| | | | | | | | | Add allow-thread. Pick-to: 6.2 5.15 Fixes: PYSIDE-1681 Change-Id: I624979c5845a3366bcd9d7827ff2c77438ec54f3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove ShibokenGenerator::guessCPythonCheckFunction()Friedemann Kleint2021-09-301-1/+1
| | | | | | | | | | | | | | | | Since all CPython types are now built-in custom types, there is no longer a need to guess the check functions. Custom types passed to writeTypeCheck should be valid AbstractMetaTypes; throw an exception if this fails. Define a check function for Qml's VolatileBool where it was relying on heuristics. Task-number: PYSIDE-1660 Change-Id: I9641c63ae2942db86dbf84488429b7e25f0491a0 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* PySide6: Clean the suppressed warningsFriedemann Kleint2021-09-211-0/+1
| | | | | | | | Remove obsolete warnings and add new ones. Pick-to: 6.1 Change-Id: If4b8d1cfcfe858e86079eac32f24c3c65cbcf583 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Shiboken: Change type(SbkType_FromSpec) to PyType_ObjectChristian Tismer2021-09-131-8/+3
| | | | | | | | | | | | This step prepares the transition of type generation to PyPy compatibility. [ChangeLog][shiboken6] SbkType_FromSpec() has been changed to return a PyType_Object *. Task-number: PYSIDE-535 Change-Id: I74e2e527e66a41f1a9f3f911f44d641139371889 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove SbkObjectType from the APIFriedemann Kleint2021-09-131-2/+2
| | | | | | | | | | Leave only a deprecated typedef. Complements a4311711eb89e3f9833a05edf3debdf7563a104f. Task-number: PYSIDE-535 Change-Id: Icab9e82e7bff99363c01e471db1c84ee8d6c0b6b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove C-style casts to SbkObjectType *Friedemann Kleint2021-09-131-16/+31
| | | | | | | | Complements a4311711eb89e3f9833a05edf3debdf7563a104f. Task-number: PYSIDE-535 Change-Id: Iedb4b03be4fcac1622c1fabf8d60e0853d939bd6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Define SbkObjectType to be a PyTypeObjectFriedemann Kleint2021-09-111-2/+0
| | | | | | | | | | | | | | | 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-173-8/+70
| | | | | | | | | | | | 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>
* PySide6: Fix crash with qmlRegisterSingletonType() when invoked from JavaScriptFriedemann Kleint2021-07-271-0/+2
| | | | | | | | | | | | Acquire the GIL in the callback to ensure Python is ready. Amends 0864de0b26888a795808faa234d9717066e821b5. Pick-to: 6.1 Fixes: PYSIDE-1629 Task-number: PYSIDE-574 Change-Id: Ie6524b39c12f1f27c427e8423dfd2190a48c1353 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* pathlib: support QQmlApplicationEngine loadCristián Maureira-Fredes2021-07-131-1/+6
| | | | | | Task-number: PYSIDE-1499 Change-Id: Ic0cec066fdf25c765c0216a80248790b9c7ea6ec Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>