aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/messages.cpp
Commit message (Collapse)AuthorAgeFilesLines
* shiboken6: Add a documentation file hint to complex type entriesFriedemann Kleint2024-11-281-0/+19
| | | | | | | | | | | | | | | | | | | | Complements ad5eb64daaaa1b927bcbf9e568738f417fef845f. Add a doc-file attribute to complex type entries (object/value/namespaces) like it was done for enums and free functions by ad5eb64daaaa1b927bcbf9e568738f417fef845f. This is mainly intended for namespaces that can be extended by other modules. Change the functions to parse WebXML to accept lists of files. Improve the error message about not finding qdoc files. Pick-to: 6.8 Task-number: PYSIDE-2918 Task-number: PYSIDE-1106 Change-Id: I2811e0715b7f44a4461876019580295f5af4ea06 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Handle QT6_DECL_NEW_OVERLOAD_TAIL within shiboken6Friedemann Kleint2024-10-021-0/+10
| | | | | | | | | | | Strip parameters of type Qt::Disambiguated_t similar to QPrivateSignal (see qtbase/0a3ff697380555538a0d035b768ddf10f772b55a). As this becomes more and more common, it saves the work of declaring those functions. Change-Id: I973b47ddcfa3ac40795885da0f4001a95ad108fd Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6/Documentation: Fix resolving images in the overview pagesFriedemann Kleint2024-09-271-3/+25
| | | | | | | | | | | | | | | | | | | | | | After the split of the WebXML output directories by qttools/c51980bb0d9658f2ade4de1900d07b08e88cb52d, the images of the overviews were no longer found by the previous algorithm. To fix this, move the copying of images from the WebXML output directories to doc/base from QtXmlToSphinx to QtDocGenerator. QtXmlToSphinx now merely collects image hrefs and the context and QtDocGenerator later resolves them in one go, first trying to resolve relative to the source documents. The old algorithm resolving by context/module is then only a fallback for rare cases of injected documents. Complements 752c1161d75f8c01e2c6c6b07ba02e9a62e65b10. Task-number: QTBUG-77650 Task-number: PYSIDE-2620 Task-number: PYSIDE-1106 Change-Id: Icd192bf2a9e235c923e3f90a3a5554c2314f94f2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Documentation: Move image resolving from QtXmlToSphinx to QtDocGeneratorFriedemann Kleint2024-06-061-0/+7
| | | | | | | | | | | | Move PySide6-related logic to the doc generator. Prepares for adapting to qttools/c51980bb0d9658f2ade4de1900d07b08e88cb52d. Task-number: QTBUG-119500 Task-number: PYSIDE-2620 Change-Id: I994bd3c159654e133d71ee7fac3725ffed47c52c Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Ignore nested containers as template parameters when inheriting a ↵Friedemann Kleint2024-05-081-0/+15
| | | | | | | | | | | | | | | | | | template Change qtbase/ab0b2a490eb98f3216403e87e4ea108a10fbeed2 removes QObject inheritance from QSignalSpy, making the QList<QVariantList> the first base class. Do not specialize this as it leads to errors later on when determining the instantiated templates. Split out the code for template parameters from inheritTemplate() to a separate helper function inheritTemplateParameter() and add error messages. Task-number: PYSIDE-2620 Pick-to: 6.7 Change-Id: I6b45d0293036b7a9177fab4d26d3e7e79d5799e6 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Extract common C++ function attributesFriedemann Kleint2024-04-171-2/+3
| | | | | | | | | | | | | | | | Extract attributes common to C++ functions from AbstractMetaFunction's attributes to a flags type in codemodel_enums.h for re-use in AbstractMetaFunction, FunctionModelItem and AddedFunction. A lot of boolean setters and getters can then be removed and the flags easily transferred from code model to the meta language code. Task-number: PYSIDE-2602 Pick-to: 6.7 Change-Id: I9da1bb0d70051cd6bb3113290e8ccedfe4d13908 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Improve code snippet error handlingFriedemann Kleint2024-01-311-0/+6
| | | | | | | | | | | | | Type conversion errors in code snippets can be hard to diagnose, particularly when they occur in an invalid context due to misspelt snippet markers. Add some functions wrapping the in try/catch, adding some context information to the error messages. Pick-to: 6.6 Change-Id: I7e35f298497b7fd0b582f43d6941a683e18377b3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Improve messages when skipping fields and functionsFriedemann Kleint2024-01-231-3/+21
| | | | | | | | Store the source location in the clang parser so that it appears in the message. Also add the access level. Change-Id: I9a9ca414a41a3fa4584dd55d580aa01bb252f9c7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Improve warning message when stripping argumentsFriedemann Kleint2023-12-211-2/+3
| | | | | | Pick-to: 6.6 Change-Id: Ibd4fd2da19811183fe8743b925ba2bf98b892541 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Extract global (non-added) function/enum documentationFriedemann Kleint2023-12-191-6/+8
| | | | | | | | | | Try to determine the name of the .webxml file in which the documentation is via include/doc file hint and write that to the globals page. Task-number: PYSIDE-1106 Change-Id: I8042d9122fa9037a602aadc2266d85d1f79f4fde Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Remove some further uses of QStringLiteralFriedemann Kleint2023-11-291-2/+2
| | | | | | Task-number: PYSIDE-2537 Change-Id: Ie71b17eec385b31842d6693b3492db565d479fd0 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Add an options parser for common optionsFriedemann Kleint2023-09-201-9/+3
| | | | | | | | | Remove the old option handling completely. Pick-to: 6.6 Change-Id: I00661b530527cd072c346b983c33b789240ce722 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Move options parsing into API extractorFriedemann Kleint2023-09-201-0/+5
| | | | | | | | | | | Similar to the previous change for the TypeDatabase, add an OptionsParser for ApiExtractor and let it handle the its options directly instead of passing them from main. via ApiExtractor. Many ApiExtractor setters can then be removed. Pick-to: 6.6 Change-Id: I3fe37e2903edcc4f6e4a91181917d008df1e5ca8 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Introduce simple option structFriedemann Kleint2023-09-201-0/+6
| | | | | | | | | | | Add a struct Options to replace the struct CommandLineArguments from main.cpp with built-in handling of the project file. Port the generators over. Pick-to: 6.6 Change-Id: I3012d211761e7a43c709f2754e6846f008ff2b0d Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Improve message about not being able to resolve typedefsFriedemann Kleint2023-08-311-0/+9
| | | | | | | Pick-to: 6.5 Change-Id: I9605d7992dfd7506c1d6e75c2719d77cfeffe449 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Remove remaining usage of QCoreApplicationFriedemann Kleint2023-07-241-3/+2
| | | | | | | | | Pass arguments to the error message. Amends 0f0f732d91f8cf717283dbfbe67c8875bf191902. Pick-to: 6.5 Change-Id: Ie40c272732468ff3d7b6b0636120710f26309347 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Improve message about missing type entriesFriedemann Kleint2023-05-121-2/+4
| | | | | | | | | | List the loaded (dependent) type systems as the reason mostly is a missing dependent type system. Pick-to: 6.5 Change-Id: Iaefd39b3097357402292b2520ae410a7fd6a8911 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* shiboken6: Refactor reject logicFriedemann Kleint2023-05-111-3/+3
| | | | | | | | | | | | | | Introduce a struct with type signature, sortkey and reason for rejected entries instead of using a QMap. This allows for sorting rejected functions by function signature excluding return type such that members of a class show up in a group. Remove unused enum value "ApiIncompatible". Pick-to: 6.5 Change-Id: I0ea29c8163c6eba2abba843355f9a9940e416d7c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Remove check for variable type in conversion snippetsFriedemann Kleint2023-05-111-17/+0
| | | | | | | | | | | | There might be subtle differences for example spaces in nested template types (QList<QSharedPointer<T> >) which are now obsolete that trigger the error. Remove the check as mostly auto is used today and it would result in a compiler error anyways. Pick-to: 6.5 Task-number: PYSIDE-2316 Change-Id: I28251549d1d103fa3e2d0f9eed405852b2195d8a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add support for excluding classes by a preprocessor condition in the module ↵Friedemann Kleint2023-02-221-1/+7
| | | | | | | | headers Task-number: PYSIDE-962 Change-Id: I5796d10bda9b760a3fd5d71dc750b3f5f7f29e94 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Port from QSharedPointer to std::shared_ptrFriedemann Kleint2023-01-051-5/+5
| | | | | | | 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/generator: Fix CMake UNITY_BUILD (jumbo)Friedemann Kleint2022-12-161-6/+4
| | | | | | | | - Use a string literal for "::" - Add a header for debug helpers Change-Id: I605a00fea1b936032afa93d9be45b7da31d42473 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Use smart pointers for AbstractMetaClass instancesFriedemann Kleint2022-12-061-18/+18
| | | | | Change-Id: I101ca8ceea6ffa63ca8bd03e2e9adf7531cb8f80 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Use smart pointers for the TypeEntry classesFriedemann Kleint2022-11-171-12/+12
| | | | | | | | | | 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-1/+1
| | | | | | | | | 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: Enable specifying namespaces for smart pointer instantiationsFriedemann Kleint2022-11-101-0/+5
| | | | | | | | | [ChangeLog][shiboken6] It is now possible to specify a namespace for a smart pointer instantiation. Task-number: PYSIDE-454 Change-Id: I9b61c3514211108fd7009e1776ae4fb8988c576b Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Port some loop variables to qsizetypeFriedemann Kleint2022-10-131-4/+4
| | | | | | | | 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: Fix indirections of enums/flag argumentsFriedemann Kleint2022-10-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | The information about how arguments are converted (pointer indirections, etc.) was in CppGenerator::writePythonToCppTypeConversion() and partially duplicated in AbstractMetaType::shouldDereferenceArgument(), leading to discrepancies in the indirections generated for the function calls. To fix this, introduce a struct GeneratorArgument with type, conversion mode, indirections and a few flags storing this information and use that everywhere, replacing AbstractMetaType::shouldDereferenceArgument(). Pass the argument indirections obtained from writePythonToCppTypeConversion() via writeArgumentConversion() as a list into writeMethodCall(). Add a test for passing enums by pointer. Fixes: PYSIDE-2065 Change-Id: I495c2bc04ebc0162648d74b75e321609ecd00963 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Refactor Handling of CustomConversionFriedemann Kleint2022-09-061-0/+8
| | | | | | | | | | | | | | | | | CustomConversion can appear in PrimitiveTypeEntry, ContainerTypeEntry and ValueTypeEntry. Move the field from the base class TypeEntry there. The deprecated QString targetConversionRule() was only implemented for ValueTypeEntry; move it from the base class TypeEntry there. In the original code, CustomConversion was stored as a raw pointer in TypeEntry. This is bad since TypeEntry are cloneable. Use a QSharedPointer to prevent crashes. Change-Id: Ia74219671bbd5792398f9711b4a020f5c9825b1b Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Fix mapping of arguments when writing virtual methodsFriedemann Kleint2022-06-271-0/+8
| | | | | | | | | | When generating the code for virtual methods, removed argument were not properly taken into account. Add a mapping method for this to AbstractMetaFunction. Change-Id: I6caf6bd676256affa7c9b85b36bec74a1c642be2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> 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>
* shiboken6: Split the typesystem headerFriedemann Kleint2022-05-171-1/+3
| | | | | | | | It was growing too large to be maintainable. Change-Id: I7d646fa92a08dd598d673c81668210c1b188b635 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Remove deprecated QLatin1StringFriedemann Kleint2022-04-251-61/+61
| | | | | | | | | | Introduce a compatibility header to provide the 6.4 API to 6.3 to reduce merge conflicts. Task-number: QTBUG-98434 Pick-to: 6.3 6.2 Change-Id: Iab3f9f894019b4135afa96b930325966348210d0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Migrate from QLatin1Char to UTF-16 char literalsFriedemann Kleint2022-04-251-4/+4
| | | | | | | | | Preparing for the deprecation of QLatin1Char in 6.4. Task-number: QTBUG-98434 Pick-to: 6.3 6.2 Change-Id: I8bc92aa9f4e6dbfcb12d2025c5a1e760ab4f0d7f Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Refactor CppGenerator::argumentNameFromIndex()Friedemann Kleint2022-04-071-0/+14
| | | | | | | | | | | | The function was returning the argument class in a pointer passed in. Split this functionality out to a separate function argumentClassFromIndex() for clarity. Use exceptions to signal errors instead of writing #error directives. Pick-to: 6.2 Change-Id: Icfdf4344bfd3bab0e65c308bebde21f6940bdbfd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add attribute "value-check-method" to smart pointersFriedemann Kleint2022-04-051-3/+3
| | | | | | | | | | | | | | | | "value-check-method" (operator bool, std::optional::has_value()), is the opposite of the existing "null-check-method" (QSharedPointer::isNull()) and takes precedence over it. Synthesize these methods for smart pointers as well. As a drive-by, actually generate the value check and null check methods. Add a test for std::shared_ptr. Task-number: PYSIDE-454 Change-Id: Ie3b6f7042883888d23c9e6bed8a1409f0bdb56b9 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken6: Synthesize missing smart pointer functions and classesFriedemann Kleint2022-03-291-14/+9
| | | | | | | | | | | | | | Add a function to create the smart pointer classes and their relevant member functions in case they are not in the code model due to being in some unspecified helper base class. [ChangeLog][shiboken6] Using std::shared_ptr has been simplified; it no longer requires specifying all implementation headers for the class declaration to be fully visible. Task-number: PYSIDE-454 Change-Id: I870ec59e55e947fa13f875c4af8756246651c466 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Split CppGenerator::generateClass()Friedemann Kleint2022-03-221-0/+12
| | | | | | | | | | | | | Split out the smart pointer part from CppGenerator::generateClass() into a separate CppGenerator::generateSmartPointerClass() along with several small helpers. This increases the clarity of the code and makes it easier to implement similar classes like std::optional or std::unique_ptr. Task-number: PYSIDE-454 Change-Id: I27ab16e2a9cef644e18e129eb18052df1b7a990f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6/Documentation: Replace XPath/Xquery usage for retrieving WebXML ↵Friedemann Kleint2021-12-161-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs by a parser shiboken used XPath expressions to extract the function descriptions from the qdoc-generated WebXML. With the deprecation of QtXmlPatterns in Qt 6, libxml/xslt was used for this. A major drawback is that libxml/xslt is unable to match entities in attributes which means functions taking parameters by const-ref could not be found. This required cumbersome workarounds involving repeated searches, which still were not sufficient to find all functions. To fix this, write a WebXML parser based on QXmlStreamReader that extracts the contents of a WebXML page into some simple data structures and use those for searching. On this occasion, also use the metafunction flags to correctly match binary operator functions. This reduces the number of functions for which no documentation can be found (from ~1100 to ~800 for the qtbase repository). From the remaining functions, ~230 are functions inherited from templates, which should at least be listed. Others are caused by qdoc not finding hidden friends. The remaining usages of libxml/xslt are the doxygen parser and the documentation modifications using XSLT. Task-number: PYSIDE-1106 Change-Id: I31c045ad42948afad884f40d5bbc8bee7555859e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix documentation generationFriedemann Kleint2021-12-101-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | The fuzzy checking introduced by 87efa57c6ddc1a8364b2ea4d9f909372d0af5cfc actually produced ambiguous matches like QStandardItemModel::insertRow(QStandardItem *), QStandardItemModel::insertRow(constd QList<QStandardItem *> &). Change this to be a 3 step process: First, try an exact type match. If that fails and there are arguments using const ref qualifications, try a fuzzy match. Check whether this produces a single match. Finally, try matching by argument count. As a drive-by, format qualifiers of template parameters like QList<QStandardItem *> correctly. Change the messages to report "Fallback used" instead of "Cannot find" if a fallback is found to make it easier to spot failures. Amends 87efa57c6ddc1a8364b2ea4d9f909372d0af5cfc. Pick-to: 6.2 Change-Id: I5b133274ae0f056e6901b0a66d385a270cabb9c9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Add further methods to smart pointersFriedemann Kleint2021-11-241-0/+6
| | | | | | | | | | | | | | | | Add attributes for reset() and null-check. The shared pointer in the test uses isNull() which works due to the --use-isnull-as-nb_nonzero option, but it should be possible to explicitly specify that. [ChangeLog][shiboken6] Attributes for reset() and null-check of smart pointers have been added. Task-number: PYSIDE-454 Pick-to: 6.2 Change-Id: I22571eeb43f7f98b6a77b31066bf8daa681cb044 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Clean up messages about cyclic dependencies of overloaded functionsFriedemann Kleint2021-11-031-3/+6
| | | | | | | | | | | | | | | Move message helper msgCyclicDependency() from overloaddata.cpp to message.cpp to prevent a clash between the static helper and the one declared in messages.h. This was an oversight causing problems in 5.15: tqtc-pyside-setup/sources/shiboken2/generator/shiboken2/overloaddata.cpp: In function ‘QString msgCyclicDependency(const QString&, const QString&, const MetaFunctionList&)’: tqtc-pyside-setup/sources/shiboken2/generator/shiboken2/overloaddata.cpp:151:16: error: ‘QString msgCyclicDependency(const QString&, const QString&, const MetaFunctionList&)’ was declared ‘extern’ and later ‘static’ [-fpermissive] Pick-to: 6.2 5.15 Change-Id: I56375c5bbc483859f83658cfeb4df1e6067421a0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Do not crash when class cannot be found in the overload sorterFriedemann Kleint2021-10-281-3/+11
| | | | | | | | | | | Print an error message instead. As a drive-by, add a helper to create a class-qualified signature for error reporting purposes to AbstractMetaFunction. Pick-to: 6.2 5.15 Task-number: PYSIDE-1684 Change-Id: I8417f405b4ce1b64060aad0696e5d328869cb83e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Store removed modification in AbstractMetaArgumentFriedemann Kleint2021-10-011-0/+12
| | | | | | | | | Similar to 984559a68d57d76b49c8ed0cbaf3492521aebebd, store the "removed" modification in AbstractMetaArgument. Task-number: PYSIDE-1660 Change-Id: Id541b4dccdcf3eba708a0da5dc873fe3b20b8151 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Refactor modified types of functionsFriedemann Kleint2021-10-011-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove AbstractMetaFunction::typeReplaced(), which returned the modified type of an argument or the return type as a string. Instead, for function arguments, for which modified types must always be valid AbstractMetaTypes, add a getter modifiedType() returning an AbstractMetaType to AbstractMetaArgument. This fixes a number of potential bugs when accessing typeReplaced(int) with the wrong position due to removed arguments. The modified argument types are parsed from the XML strings in early on in AbstractMetaClass::fixFunctions() with proper error reporting. For return types, for which modified types need to be valid only when generating a type check for virtual method return in the C++ wrapper, add a function modifiedTypeName() to AbstractMetaFunction. Adapt the client code accordingly. Split apart CppGenerator::writeTypeCheck() into one overload taking an AbstractMetaType and one taking a string. Task-number: PYSIDE-1660 Change-Id: Id95379892b40ae2632ca33ed27263bada0ec015d Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Remove ShibokenGenerator::guessCPythonCheckFunction()Friedemann Kleint2021-09-301-0/+6
| | | | | | | | | | | | | | | | 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>
* shiboken6: TypeEntry: Use a pointer to the target lang API type entryFriedemann Kleint2021-09-241-0/+6
| | | | | | | | | | | | | Replace the string m_targetLangApiName by a pointer to the type entry; allowing to retrieve the check function. Similarly, in TargetToNativeConversion::sourceTypeCheck(), use the existing type entry to retrieve the check function, allowing for removing some heuristics. Task-number: PYSIDE-1660 Change-Id: Ieeda43f804b4e129d3cc0984e36bd0c0d546fd86 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Improve message for a mismatched global functionFriedemann Kleint2021-09-241-2/+6
| | | | | | | | Output a list of candidates with matching name in case some type was misspelt. Change-Id: Ie763a912d02907d562f3feeb2eba44e811d80118 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Add support for built-in typesFriedemann Kleint2021-09-171-0/+11
| | | | | | | | | Add a built-in flag to TypeEntry and fix the duplicate type entry checking logic to handle built-in types with a different warning. Task-number: PYSIDE-1660 Change-Id: I22b0fc92b0f19b4163a4311441638176ff6a4bfb Reviewed-by: Christian Tismer <tismer@stackless.com>