aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/abstractmetabuilder.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-281-125/+0
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* shiboken2: AbstractMetaType: use QSharedData[Pointer]Friedemann Kleint2020-10-231-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, shiboken2 kept AbstractMetaType by a raw pointer. The data were copied numerous times by AbstractMetaType::copy() when adding the inherited functions to a AbstractMetaClass or specializing templates, sometimes with a bool flag indicating ownership. To get rid of the copies and ownership issues, change the type to be based on QSharedData[Pointer]. It can then be passed around and treated like a C++ value type, with Qt sharing the data when possible behind the scenes. - Extract AbstractMetaType to a separate header/source - Remove unused AbstractMetaType::setInstantiationInCpp() - Remove unused member m_package - Rewrite the comparison of AbstractMetaType which becomes relevant for checking/detaching to do a complete comparison. It was previously unused, intended for a different implementation of view types with special cases. - Rework debug formatting - Invalid meta types are indicated by the "Invalid" usage pattern instead of null pointers Change-Id: Ic4b1feecafb4f0355f39e178c2703b104e45cf6c Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* shiboken2: MetaBuilder/ApiExtractor/Generator: Return class/enum/function ↵Friedemann Kleint2020-09-281-5/+5
| | | | | | | | | | lists by const ref This allows for removing a few temporary variables and/or qAsConst(). Task-number: PYSIDE-1075 Change-Id: I0fe3544f0ce4d3a8d56de9c93e300972e0844177 Reviewed-by: Christian Tismer <[email protected]>
* shiboken: Allow for multiple header files on command lineFriedemann Kleint2020-06-031-1/+3
| | | | | | | | | | | | | | | | | | Change ApiExtractor and MetaBuilder to use QFileInfoList. Refactor the options handling to work on a struct separating options from positional arguments to make handling multiple file names easier. Refactor and streamline the options parsing code a bit, avoid duplicated parsing of project files. Print the usage when positional arguments are missing. [ChangeLog][shiboken] shiboken now accepts multiple headers on the command line. Change-Id: I221ab5a71232af1323408f77295137dc92e3d582 Reviewed-by: Christian Tismer <[email protected]>
* shiboken: Introduce flags for AbstractMetaBuilder*::translateType*Friedemann Kleint2019-09-121-2/+9
| | | | | | | This is a preparation for further extensions. Change-Id: I5279f351f7964f17ee3ca92386c10d3b90b5d8c8 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* shiboken: Allow for include paths with relative directoriesFriedemann Kleint2019-04-041-0/+2
| | | | | | | | | | Resolve the absolute file paths of the code model items against the include paths of shiboken to reconstruct the relative paths. Change-Id: Id0f793315b01c0fc65a4cfb26b3372f9c6688872 Fixes: PYSIDE-975 Reviewed-by: Volker Aßmann <[email protected]> Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* shiboken: Refactor AbstractMetaBuilder::classesTopologicalSorted()Friedemann Kleint2019-04-011-4/+2
| | | | | | | | | | | | | | | | | | Change the function parameter to be a list always, making the logic of the inner classes clearer. In the implementation, use a of QHash<AbstractMetaClass*, int> instead of hashing by name, which makes it possible to disambiguate namespaces extended in modules. This also allows for a drastic simplification of the code trying to determine the dependency given by parameter default values. Instead of trying to match by name, correctly qualifying it, the matching can be done by TypeEntry pointers. Change-Id: Ia17bf6e109576bac029fb016e5e11309777d0735 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* shiboken: Add option to skip deprecated functionsFriedemann Kleint2019-01-311-0/+3
| | | | | | | | | | | | | Pass the "deprecated" annotation from Clang into the meta language and reject functions based on it when the the command line option --skip-deprecated is set. By default, have Python output a deprecation warning when a deprecated function is called (which is visible when passing -Wd). Task-number: PYSIDE-487 Change-Id: Ic28d82963fde11f258b2559b562d3f24017fe98d Reviewed-by: Alexandru Croitor <[email protected]>
* shiboken: Refactor finding of enumsFriedemann Kleint2018-09-281-0/+2
| | | | | | | | | | In the AbstractMetaBuilder, change the list of enums into a QHash with the type entry as key since that is mostly used for searching. Streamline and simplify the search functionality accordingly. Task-number: PYSIDE-817 Change-Id: I205cad1f90bc26511ea6b6e9b76ddb1bae544cf1 Reviewed-by: Christian Tismer <[email protected]>
* shiboken: Streamline type parsingFriedemann Kleint2018-07-111-0/+12
| | | | | | | | | | | | | | | | Extract a static AbstractMetaType *AbstractMetaBuilder::translateType() method from the existing AbstractMetaBuilderPrivate::translateType() which can be passed the current class. Internally, add a AbstractMetaBuilderPrivate::translateTypeStatic() method that takes AbstractMetaBuilderPrivate parameter. Use that in conjunction with the TypeParse code to remove the type parsing code in ShibokenGenerator::buildAbstractMetaTypeFromString(). Task-number: PYSIDE-672 Change-Id: Ia17f0eb542099dcb843a59708110fc9d90fab12f Reviewed-by: Alexandru Croitor <[email protected]>
* shiboken: Remove unused code from the generatorsFriedemann Kleint2018-06-281-2/+0
| | | | | Change-Id: I88c4148000acba2ba1e2013fe587e7f5fbe6c2ca Reviewed-by: Christian Tismer <[email protected]>
* shiboken: No longer hard-code the C++ language levelFriedemann Kleint2018-06-271-1/+5
| | | | | | | | | | | | | | | | | | | The C++ language level was previously hard-coded in the default options. This is potentially problematic for projects using shiboken and also fell apart with Qt 5.12, where the experimental level "c++1z" used for MSVC2017/Clang 4 no longer works due to not being able to handle enumerator value deprecation attributes. Introduce an enumeration to represent the level and add functions to convert back to and forth to the respective Clang option. Add an option to shiboken. Add a function returning a default value for the emulated compiler, returning C++ 14 or C++1Z for the CMSVC2017/Clang 4 case. Task-number: PYSIDE-724 Change-Id: Ie7e19bf7f099a34e6cdaad4b462157a9a3ee8797 Reviewed-by: Christian Tismer <[email protected]>
* Change license from all the filesCristian Maureira-Fredes2018-05-031-1/+1
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Alex Blasche <[email protected]>
* Rename PySide references to Qt for PythonCristian Maureira-Fredes2018-04-271-1/+1
| | | | | | | | | When referring to the project one should use "Qt for Python" and for the module "PySide2" Change-Id: I36497df245c9f6dd60d6e160e2fc805e48cefcae Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Alexandru Croitor <[email protected]>
* shiboken/AbstractMetaBuilder: Remove create* functionsFriedemann Kleint2017-12-091-9/+0
| | | | | | | | There are no classes deriving from AbstractMetaBuilder, so there is no need to have virtual creation functions. Change-Id: I2d4c494ac6b0a17ceea71939a1f07a49a369df73 Reviewed-by: Alexandru Croitor <[email protected]>
* move everying into sources/shiboken2 (5.9 edition)Oswald Buddenhagen2017-05-221-0/+106
in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.