aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move the QML registration code into a libraryFriedemann Kleint2021-12-081-455/+0
| | | | | | | | | 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>
* Add a QmlSingleton decoratorFriedemann Kleint2021-11-161-9/+32
| | | | | | | | | | 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-151-1/+5
| | | | | | | | | | | 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 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-101-6/+33
| | | | | | | | | | 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-091-423/+35
| | | | | | | | | | | | | | | | | | | 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>
* 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>
* Implement qmlRegisterSingletonInstanceCristián Maureira-Fredes2021-08-171-7/+51
| | | | | | | | | | | | 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>
* Fix leak in QML ListProperty typeBrett Stottlemyer2021-07-121-0/+3
| | | | | | | | | | Even if propListTpFree() is called, the memory isn't associated with userData unless tpInit() succeeds. Pick-to: 6.1 Task-number: PYSIDE-1617 Change-Id: I825eb7393088633938e6fe5697308a2e05380e5c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside: Fix some clang analzyer warningsFriedemann Kleint2021-03-111-10/+10
| | | | | | | | | | | | - Use nullptr - Initialize variables - Remove else after return - Remove C-style casts - Avoid constructing QString from const char * - Use emit for signals Change-Id: I6ba8cad51f4b2a22f94996d1a9d8c3ae87c35099 Reviewed-by: Christian Tismer <tismer@stackless.com>
* signature: Provide fixes and improvements, Part 1Christian Tismer2021-01-211-3/+3
| | | | | | | | | | | | | | | | | | | | The signature module is modified again to be more correct when using the mypy application. This part splits some changes which occurred when working on Shiboken.Enum inheritance. There will be a number of follow-ups: - signatures for all shiboken types - test cases for signatures - signature support for different __feature__ selections Change-Id: Ifb0d92bf7641f2909ab950e3458b3c3c68c20dad Pick-to: 6.0 Pick-to: 5.15 Task-number: PYSIDE-510 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Fix QML list registration code to compileFriedemann Kleint2020-11-121-6/+6
| | | | | | | The list interface was ported to qsizetype. Change-Id: I1d69e64e73021028db1db8f1cce75e6a757e608b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* pyside6: Fix Limited API violation in QtQmlChristian Tismer2020-11-121-1/+1
| | | | | | | | | This patch replaces an unsupported function. No idea if there are more problems, since I have to create a new macOS build of the dev branch, first. Change-Id: I3ce59d5585410109a776cef19879ae835f6cce5d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-021-0/+732
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>