aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetalang.h
Commit message (Collapse)AuthorAgeFilesLines
* shiboken6: Generate Python override code for added virtualsFriedemann Kleint2024-04-221-0/+1
| | | | | | | | | | | | Introduce "Python override" as a special type of user-added function which will cause a function calling a Python override into the native wrapper. This can then be called from a virtual that has a signature which cannot be handled in Python. Fixes: PYSIDE-2602 Pick-to: 6.7 Change-Id: I5fc44ebe3f585078e87d3230d5e6f4faa67a4ee1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove class attribute FinalInTargetLangFriedemann Kleint2024-04-171-5/+0
| | | | | | | | | | | | | | Similar to the function attribute, it does not have any impact on the generated code. Its only usage was in AbstractMetaClass::functionsInTargetLang() which is used by the documentation generator only, but it did not seem to have any impact. Pick-to: 6.7 Task-number: PYSIDE-2602 Change-Id: I0a27dc046ce7fbb147c8032cccbf63257157fc89 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add more debug operators for AbstractMetaClassFriedemann Kleint2024-01-291-0/+3
| | | | | | | Add versions for the non-const shared ptr and raw pointer. Change-Id: I0562992474982fe7cb28d3fb146f67fbfe95c76b Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Port the MetaClass::find*() helpers to QAnyStringViewFriedemann Kleint2023-11-271-6/+6
| | | | | | Task-number: PYSIDE-2537 Change-Id: I7d9c160b4b8c46854b11722c05510da766dcc3f5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix deprecation warnings in Qt 6.6Friedemann Kleint2023-06-141-1/+4
| | | | | | | | | Remove old string literals, qAsConst, use new Regex API. Pick-to: 6.5 Change-Id: Iffdaa5217596e181c0766d161ce70c0a36ba37b5 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Port from QSharedPointer to std::shared_ptrFriedemann Kleint2023-01-051-1/+1
| | | | | | | Task-number: QTBUG-109570 Change-Id: Iabdafb0a5ab211e32c1bbf7face78fd5102a49b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Include base class wrapper headers of the current module when ↵Friedemann Kleint2022-12-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | avoiding the protected hack When avoiding the protected hack, the generated wrapper headers need to be included to generate casts to the wrapper classes. This was previously done by generating the entire class declaration into the header, omitting its extra includes, which causes clashes in CMake UNITY_BUILD (jumbo) builds and is a violation of the ODR rule. Improve this by generating include statements for inherited wrapper headers of the current module. For classes from other modules, generate the declarations as before, as wrapper headers are not installed. Task-number: PYSIDE-2155 Task-number: PYSIDE-500 Change-Id: Ib7caa3f49901090d7d94274018e04ccde2ebfdf9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Use smart pointers for AbstractMetaClass instancesFriedemann Kleint2022-12-061-31/+32
| | | | | Change-Id: I101ca8ceea6ffa63ca8bd03e2e9adf7531cb8f80 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Make AbstractMetaClass::fixFunctions/addFunction*() staticFriedemann Kleint2022-12-051-5/+5
| | | | | | | | Preparing for the introduction of smart pointers for AbstractMetaClass. Change-Id: I74b1a4fc52319099dae39040179ffb197bac27a7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Make some AbstractMetaClass query functions free functionsFriedemann Kleint2022-12-051-7/+12
| | | | | | | | | Preparing for the introduction of smart pointers for AbstractMetaClass. Change-Id: Ie8cbf6bd8abbae4445c34611dd7193297611d48e Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Store the property documentation in QPropertySpecFriedemann Kleint2022-11-241-0/+1
| | | | | | | | | | | | Similar to AbstractMetaFunction and AbstractMetaClass, store the documentation (brief/detail) in QPropertySpec. Task-number: PYSIDE-1106 Task-number: PYSIDE-1019 Pick-to: 6.4 Change-Id: Ide236b5918c135e331149ca384ed973fd794b55f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Parse the notify specification from Q_PROPERTYFriedemann Kleint2022-11-231-1/+2
| | | | | | | | | | | To be used for documentation purposes. Task-number: PYSIDE-1106 Task-number: PYSIDE-1019 Pick-to: 6.4 Change-Id: I833193be0007dbdba2e3fde75c64dfc2a85a4ef7 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Purge remaining uses of old Qt string literalsFriedemann Kleint2022-11-221-1/+1
| | | | | | | | | | Amends a3e882b06eda8f9a63cf3834a99640034775269b. Pick-to: 6.4 Task-number: QTBUG-98434 Change-Id: I23ad60d6e4201aa2d8dbf3fa8892d3df3c56c5fc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Use smart pointers for the TypeEntry classesFriedemann Kleint2022-11-171-7/+7
| | | | | | | | | | TypeEntry instances were previously stored and passed as raw pointers, which made it difficult to track ownership, particularly when synthesized classes were added. Change it to use QSharedPointer. Change-Id: I3612efbc5d467ebeac9aa5dda86c7439bbd03ddd Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Fix coding style regarding pointers (Type* v -> Type *v)Friedemann Kleint2022-11-141-3/+3
| | | | | | | | | As a drive-by, introduce some auto and streamline the code. Pick-to: 6.4 Change-Id: If84a3721a50b2e00b473ba78cba184f1a35d326b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Reorder headers containing typedefsFriedemann Kleint2022-11-111-2/+2
| | | | | | | | | | | | | | | - Split out Modifications/CustomConversions-related typedefs to separate headers customconversion_typedefs.h, modifications_typedefs.h - Move forward declarations of TypeEntries from typedatabase_typedefs.h to typesystem_typedefs.h - Rename TypeEntries to TypeEntryCList and add "C" to other lists containing const pointers following the shiboken convention. Pick-to: 6.4 Change-Id: Ic31872405778d794d85694386990b50edf42beec Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Add --lean-header optionFriedemann Kleint2022-11-031-0/+1
| | | | | | | | | | | | | | | | | | | | | Add an option that causes shiboken to generate forward declarations instead of includes where possible into the module header. This works since SbkType<> template specializations work with forward declarations. Includes are only required for certain classes (with enums, inner classes). [ChangeLog][shiboken6] An option --lean-header to generate forward declarations instead of includes into the module header has been added. This considerably reduces the dependencies but may require additional includes to be specified for injected code. Pick-to: 6.4 Fixes: PYSIDE-2099 Change-Id: I01f639e4ccce5ca25016dc2d52562abcc489a5ab Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Store whether class is a structFriedemann Kleint2022-10-311-1/+2
| | | | | | | | | | This is important for generating forward declarations. Pick-to: 6.4 Task-number: PYSIDE-2099 Change-Id: I68bebd8e1a0ab10525abc6784af9c375340e5871 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Port some loop variables to qsizetypeFriedemann Kleint2022-10-131-1/+1
| | | | | | | | Where possible, used range-based for. Otherwise, use qsizetype for loop variables. Change-Id: I4773bee8468ce73722656ec73845369b7d40d4cd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Clean up includesFriedemann Kleint2022-09-211-1/+0
| | | | | | | | | Remove unused includes from headers; add includes to sources where needed. Change-Id: I05efd95a9340eaf42cc5d606e2aef97acdaf83c7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Implement the spaceship comparison operator of C++ 20Friedemann Kleint2022-06-211-0/+2
| | | | | | | | Synthesize all comparison operators if one is found in the code model. Task-number: QTBUG-103757 Change-Id: I78fbcd93bc4cd172266f9dd0dbb2ebcf3a8bb7f2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Introduce an attribute for parent ownership heuristicsFriedemann Kleint2022-05-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The parent ownership heuristics cause some unintended ownership transfers to be generated that can cause crashes. However, completely removing them would mean to have to explicitly specify it in each QObject-derived class constructor. To improve this, introduce an attribute to restrict the heuristics to classes to which this is applicable. For compatibility, the attribute is only honored in shiboken 6 if some class in the type system explicitly specifies it. For shiboken 7, it will be mandatory. [ChangeLog][shiboken6] An type system attribute for restricting the parent ownership heuristics to relevant classes has been introduced. The workaround 0e62c4db50472f8b581022c86a6be651158d0cd0 can then be reverted. Task-number: PYSIDE-1939 Change-Id: I0fb01e9842aecbccaa686ce71b2163b20a97cbf7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use SPDX license identifiersLucie Gérard2022-05-271-27/+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>
* Expose the qHash() functions as tp_hashFriedemann Kleint2022-05-031-1/+3
| | | | | | | | | | | | | The hash function attribute in AbstractMetaClass was so far populated by the code model but unused by the generator. Change the AbstractMetaClass attribute to be a string (to accommodate for std::hash as well in a later change) and use it in the generator. [ChangeLog][PySide6] All qHash() functions are now exposed to Python. Fixes: PYSIDE-1906 Change-Id: I8b4cc503d8b073a6d437bbc0f6c5c7e048ec7ab9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Refactor AbstractMetaClass::findFunction[s]() to use QStringViewFriedemann Kleint2022-04-251-2/+2
| | | | | | | | | UTF-16 string literals can then be passed as search strings. Pick-to: 6.3 6.2 Task-number: QTBUG-98434 Change-Id: Id3ce2934840ec56b3e2c4e070ed47321a264afa9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Refactor AbstractMetaClass::findClass() to use QStringViewFriedemann Kleint2022-04-251-2/+2
| | | | | | | | | UTF-16 string literals can then be passed as search strings. Pick-to: 6.3 6.2 Task-number: QTBUG-98434 Change-Id: I2ce9f3b44b704a24c01249c60e8e7a5a01ab38ba Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Use more const for functions dealing with AbstractMetaClassFriedemann Kleint2022-04-201-9/+9
| | | | | | | Pick-to: 6.3 Change-Id: I20b7f662271d8ebd929584d1a04ce9c068b7a3e7 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Remove some unused codeFriedemann Kleint2022-04-201-19/+2
| | | | | | Pick-to: 6.3 Change-Id: Ie5dc344b6daf433f6d7522b05e170a0baa848d32 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Replace hasCloneOperator() by isCopyConstructible()Friedemann Kleint2022-04-201-3/+0
| | | | | | | | | | hasCloneOperator() is a left-over and does not handle all base classes as does isCopyConstructible(). Pick-to: 6.3 Change-Id: I2dbf8bc9e27b0cc776005904a85020fa25efa5ea Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Fix handling of value types with protected constructorsFriedemann Kleint2022-01-181-1/+2
| | | | | | | | | | | | | | | | | | Value types with some protected constructors (like QOperatingSystemVersionBase in 6.3) caused compile errors on Windows where the protected hack is disabled since non-accessible constructors were used. The check for isValueTypeWithCopyConstructorOnly() needs to be fixed to exclude protected constructors in case AvoidProtectedHack is set. Similarly, the visibility of the minimal default constructor needs to be checked. Add the AvoidProtectedHack setting to ApiExtractorResult for this purpose since it influences the API in a way. Pick-to: 6.2 Change-Id: Ifeab320b9391aa21c5b1de4d21d2d8276fe44d3f Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Rewrite some helpers in terms of QStringViewFriedemann Kleint2021-10-281-1/+1
| | | | | | | | | | This is a prerequisite for refactoring functions qualifying argument default values, allowing them to operate on substrings. Task-number: PYSIDE-1691 Pick-to: 6.2 Change-Id: I5b368fdfe162ecc1a69a3958ed21d3563a05e1b0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Refactor handling of values with copy constructor onlyFriedemann Kleint2021-09-111-0/+2
| | | | | | | | | | | | | | | ShibokenGenerato::valueTypeWithCopyConstructorOnly() is frequently called when writing argument conversions. Instead of repeatedly searching for classes and looping its functions, determine the value once in AbstractMetaBuilder and set it as a boolean flag on class and type entry. Move the functions from ShibokenGenerator to AbstractMetaType. Task-number: PYSIDE-1605 Change-Id: If6701ff87b8dd23039f1d35daa6c9291acd0aa87 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Handle hidden methods/"using" correctlyFriedemann Kleint2021-09-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In C++, declaring a non-override method in a class hides all methods of the same name from the base class unless they are made visible by a "using Base::name" specification. Shiboken did not observe this rule; base class methods were added nevertheless, causing problems with code snippets. In addition, there were several places where the recursion for the inherited base class methods was done. Move the collection of inherited base class methods into ShibokenGenerator::getFunctionGroups() and implement proper handling of using declarations. This function then returns the authoritative list of functions to be generated. Remove a few cases from the test. [ChangeLog][shiboken6] The handling of hidden base class member functions and using declarations has been fixed. Fixes: PYSIDE-1653 Change-Id: I62c9ec47617f94098c4a27a557a23bbfeaad805c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Refactor AbstractMetaClass:inheritsFrom()Friedemann Kleint2021-07-211-2/+2
| | | | | | | | | | Reimplement AbstractMetaClass::inheritsFrom() to go through the list of base classes and the template base class. Add an overload taking a name and use that in some cases. Change-Id: I736fd64bba3365ee9f2ee586844166ed64002706 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Fix missing functions from base classesFriedemann Kleint2021-07-211-0/+1
| | | | | | | | | | Add all occurrences found by name in getInheritedOverloads(). This manifested in missing overloads of QWidget::addAction() introduced by qtbase/08e4d2db084f6abbf1840ffb694b15bd215ad069. Pick-to: 6.1 Change-Id: I6b3bf143d32addbbb6b8332bed5e86e1677b0e28 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add support for operator boolFriedemann Kleint2021-07-021-0/+3
| | | | | | | | | | | | | | | | [ChangeLog][shiboken6] operator bool can now be used for bool conversions (nb_bool) besides Qt-style isNull() methods. Add a command line option --use-operator-bool-as-nb_nonzero similar to use-isnull-as-nb_nonzero, enabling the use of operator bool for bool conversions. Make it possible to override both settings in typesystem XML. Task-number: PYSIDE-1334 Change-Id: I9c567e1b2cb97b22b41b3d9918046d793632160e Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Fix increment/decrement operatorsFriedemann Kleint2021-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | For classes that have increment/decrement operators (++/--), shiboken6 generated operators +=/-= ( __iadd__/__isub__) by calling them n times. This was mainly intended for iterators. However, when both operator++/-- and operator+=/-= were present (as introduced by qtdeclarative/f8f31dd0e1f9425ba272691c79e719ebc4bcfb94 for QJSPrimitiveValue), duplicate code and errors were generated. This requires filtering of the operator functions. Introduce a separate function type for increment/decrement operators and remove them if operators +=/-= were found. Also, when both prefix and postfix version of the increment/decrement operators are found, remove one. Extend existing class IntWrapper from libsample for testing. Add explanatory comment and use prefix increment. Pick-to: 6.1 Change-Id: I0f8a0c79a6f74974ba327d21f35fff74962ffd3a Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Prevent crashes when registering static fieldsFriedemann Kleint2021-04-131-0/+1
| | | | | | | | | | | | | | | Registering static fields invokes converters, which can cause crashes for uninitialized types (see also 2ac1870053370e017567ae53e62cd1155a01c88f). To solve this problem, move the static field initialization to the end of the module initialization function to ensure all converters are available. Pick-to: 5.15 6.0 Fixes: PYSIDE-1529 Change-Id: If40c6faf049077db8afcdee2069f4441c21beaa4 Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Add constructors of base classes imported via "using"Friedemann Kleint2021-03-011-0/+9
| | | | | | | | | | | | | Parse "using" declarations in the clang builder using some code from the base class determination algorithm. Resolve them to struct UsingMember containing the base class and the member name in the metabuilder and check whether any base constructors are imported via "using". Add them as functions like the default constructor. Change-Id: I121a70f0591c6d1e6f9daedfb653206c49c07a3f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove AbstractMetaAttributesFriedemann Kleint2021-02-191-2/+37
| | | | | | | | | | | | Remove AbstractMetaAttributes as a base class of AbstractMetaFunction and AbstractMetaClass. Split the Attributes enumerations into those applying to classes and functions, respectively and add them to AbstractMetaFunction and AbstractMetaClass. Change-Id: Ie60517876af4096fd6234479ee7dc7fbcca1eda6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Improve detection of default/copy constructabilityFriedemann Kleint2021-02-171-2/+14
| | | | | | | | | | | Add support for deleted functions. Extend the checks for default constructability by checks for fields and base classes. Refactor the check for copy constructability to recursively check on base classes. Remove functionality for adding private copy constructors which was apparently unused. Change-Id: I8105f277699d6121aa8aa193d9cb16bf8133e901 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Refactor C++ wrapper generation handlingFriedemann Kleint2021-02-021-0/+11
| | | | | | | | | | | | | | | The "disable-wrapper" attribute introduced by 1d044f467070a040713c9566a8a8de3a56c571e7 was not working in case the protected hack was disabled due to inconsistent, duplicated checking of conditions. Move the wrapper check into AbstractMetaClass and let it return a flags type that indicates whether the wrapper is needed for protected functions or virtual methods. Task-number: PYSIDE-1202 Change-Id: I56c0ed58a70d36e53fdd8a9c76f5eff0a832f469 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6/ApiExtractorResult: Use const AbstractMetaClass * for the class listFriedemann Kleint2020-12-221-0/+4
| | | | | | | | | | Add the missing overloads of AbstractMetaClass::findClass() and adapt some types. Pick-to: 6.0 Change-Id: I65851248b4b6a2e1d4f57fc58ecaf75fb4c00b29 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Refactor base class retrievalFriedemann Kleint2020-12-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | AbstractMetaClass has a list of base class names and a list of AbstractMetaClass* base instances. AbstractMetaBuilder populates the instance list from the names in setupInheritance() and sets a flag. In a few places in AbstractMetaBuilder, the base class instances are needed before this has been completed. For this purpose, the helper AbstractMetaBuilder::getBaseClasses() is needed. Replace the set of classes m_setupInheritanceDone by a flag on AbstractMetaClass. This allows for adding an assert to AbstractMetaClass::baseClasses() ensuring setupInheritance() has been called and taking a shortcut in AbstractMetaBuilder::getBaseClasses(). In addition, classesTopologicalSorted() can use AbstractMetaClass::baseClasses() instead of searching with AbstractMetaBuilder::getBaseClasses() and can thus be made static. Pick-to: 6.0 Change-Id: Iaf8209b6f6534ad91a96970a56c1e86cce054922 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Determine function types in the code modelFriedemann Kleint2020-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Extend the _FunctionModelItem function type enumeration by operator types and determine them by name or from clang. Split the bitwise operators into shift and other bitwise operators for stresm operator detection. Similarly, add operator type values to AbstractMetaFunction::FunctionType and replace the isOperator() checks accordingly. Remove the unused isOtherOperator() function. Rename AbstractMetaFunction::isNormal() to needsReturnType() for clarity. Rewrite the binary operator search in AbstractMetaBuilder by checks based on enumeration value and rewrite traverseOperatorFunction to return a bool so that shift operators are found when stream operator is not applicable. Rewrite the function query functions of AbstractMetaClass to also use the enumeration values. Pick-to: 6.0 Change-Id: I06cc2deefcd8a158f83c95513a7962de467f7f2a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Move the function/operator query enumerations out of ↵Friedemann Kleint2020-12-101-44/+2
| | | | | | | | | | | AbstractMetaClass This makes it possible to use them in cppgenerator without converting to uint. Pick-to: 6.0 Change-Id: Ice31487d0d053446988f896b4967fa83c656a0d3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Simplify handling of removed attributeFriedemann Kleint2020-12-021-1/+1
| | | | | | | | | | | | The meaning of the TypeSystem::Language enumeration value on the remove elements was unclear; and it is only ever used with 'all'. Replace it by a boolean value and simplify the code accordingly. Adapt the documentation. Change-Id: I82d082e6d551403642936294a11abbac09d723dd Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Fix some functions to take a const AbstractMetaClass *Friedemann Kleint2020-12-011-2/+2
| | | | | Change-Id: Iccee5cab96362250997daf39a354ddc7e8ab2909 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Store AbstractMetaFunction using a QSharedPointerFriedemann Kleint2020-11-301-18/+17
| | | | | | | | | | | | | | | | | | Store the list functions (global / class member) as a QList<QSharedPointer<const AbstractMetaFunction> instead of a raw pointer list. This makes passing around function lists easier and solves the memory leaks caused by mixing cloned and unmodified functions while collecting the overload lists in the generators. - Change the function signatures accordingly - Add a qSharedPointerConstCast() for non-const access. - Restructure the traversing of added functions in the AbstractMetaBuilder - Remove some unused typedefs and functions unearthed by the change Change-Id: I08a6c5243750e3eb3813bc3f7172899ad2b13e22 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Replace QVector by QListFriedemann Kleint2020-11-251-2/+2
| | | | | | | | | | | | | | | | 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>