aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetaenum.cpp
Commit message (Collapse)AuthorAgeFilesLines
* shiboken6: Fix static analysis warningsFriedemann Kleint2024-06-241-1/+1
| | | | | | | | | | | | | | | | | | - Initialize variables - Use auto * - Use const references to prevent copies - Remove const from function returns - Remove repeated return types - Fix else after return/throw - Make functions const/static where appropriate - Add missing override - Fix some invocations of static methods - Fix some int types (qsizetype) to avoid lossy conversions - Minor cleanups - Remove some macros Change-Id: I414b8451703b136f135383289de49e743e84fb3a Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Fix clang-tidy warning [performance-noexcept-move-constructor]Friedemann Kleint2023-09-191-4/+4
| | | | | | | | | Add noexcept, fixing: warning: move assignment operators should be marked noexcept. Pick-to: 6.6 6.5 Change-Id: I4d1244d07bdb88fafb8e67158cfdd4c53119c8b3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* shiboken6: Refactor the used bits calculation of the enum codeFriedemann Kleint2023-07-031-0/+46
| | | | | | | | | | | | | Move the helpers from the generator to AbstractMetaEnum. Do not do anything if a custom type is specified for the enum in the type system. Maintain the original signedness of the enum type. Amends 895c452fd874fe4dfeb5a44e8c959136ceedba13. Task-number: PYSIDE-1735 Change-Id: Ibb851f9f2c14b5affb71ee381459f6f56e1af23b Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyEnum: Shortcut old Enum code and generate Python enums directlyChristian Tismer2023-06-301-0/+10
| | | | | | | | | | | | | | | | | The amalgamation of old and new enums is slowly unraveling from the inside. This meanwhile actually removes the old code. Included a change by Friedemann to improve enum value handling. After the signed/unsigned problem was fixed, there was only one case left where Qt and Clang parser disagreed which could be fixed. The final solution uses overloaded functions to generate all necessary cases with minimal footprint in the executable. Task-number: PYSIDE-1735 Change-Id: I3741ce8621e783a750f3c05241c916008f78f39b Done-with: Friedemann.Kleint@qt.io (+2 squashed commits) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Change the debug output for enums with flags to hexFriedemann Kleint2023-06-271-3/+7
| | | | | | | Task-number: PYSIDE-1735 Task-number: PYSIDE-2088 Change-Id: I96d2cde0b4b933151e839a236e62efb1115015b8 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add the underlying type to AbstractMetaEnumFriedemann Kleint2023-06-201-4/+17
| | | | | | Task-number: PYSIDE-1735 Change-Id: I7733c93baffa1396d5a43b68069e9e8848e9fe49 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Store a const TypeEntry in AbstractMetaEnumFriedemann Kleint2023-05-101-3/+3
| | | | | | Pick-to: 6.5 Change-Id: I98acca609a219427a3da34bc63489cbd54c2c4a8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Use smart pointers for the TypeEntry classesFriedemann Kleint2022-11-171-3/+3
| | | | | | | | | | 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: 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>
* shiboken 6: Generate warnings about deprecated enum/valuesFriedemann Kleint2022-08-241-0/+21
| | | | | | | | | | | | Add warnings message functions and generate calls into the converter functions. [ChangeLog][shiboken6] Shiboken now generates warnings about using deprecated enumerations and deprecated enumeration values. Task-number: PYSIDE-1735 Change-Id: I8bb1a1856d33b4313842ad9ed581274b48d93138 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Propagate C++ enum deprecationFriedemann Kleint2022-08-221-3/+33
| | | | | | | | | | | | | Add AbstractMetaEnum::isDeprecated() and AbstractMetaEnumValue::isDeprecated() which are set by the clang parser for deprecated enums and values (for example, QVariant::Type). As a drive-by, streamline the debug output of the enums, removing the repretitive EnumValue type name. Task-number: PYSIDE-1735 Change-Id: I4c98965ca4a948f5f084f781914194e5bf4d4ea2 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/+1
| | | | | | | | 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-1/+5
| | | | | | | | | | 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 QLatin1String to UTF-16 string literalsFriedemann Kleint2022-04-251-1/+1
| | | | | | | | | | Use the QStringView overloads of the comparison functions in order to minimize merge conflicts after the deprecation of QLatin1String in 6.4. Task-number: QTBUG-98434 Pick-to: 6.3 6.2 Change-Id: Ia0df398ab8f3e61a0b629971ccbec2273a78499b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Migrate from QLatin1Char to UTF-16 char literalsFriedemann Kleint2022-04-251-1/+1
| | | | | | | | | 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: Fix debug operator of AbstractMetaEnumValueFriedemann Kleint2021-10-281-4/+1
| | | | | | | | It should print the name always. Pick-to: 6.2 5.15 Change-Id: Ie44382a2a8f7901a96f2901a4bb21b2ed22b7197 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Move C++ access specifiers into a global enumFriedemann Kleint2021-02-171-0/+12
| | | | | | | | | | | | | | | | | | | | | Extract the AcessPolicy enum from the code model into a global enum and remove the access specifiers from AbstractMetaAttributes. AbstractMetaField and AbstractMetaEnum get access()/setAccess() functions and no longer need to inherit AbstractMetaAttributes which removes the attributes that do not apply to them. AbstractMetaFunction gets access()/setAccess() functions, too, and handling for remembering the original access before modifications. AbstractMetaAttributes::originalAttributes can then be removed since it is not used otherwise. Simplify the code accordingly. Change-Id: Ie4529fc753f127975b5c56ee07b27419802361d6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Port AbstractMetaEnum/Value to use QSharedDataPointerFriedemann Kleint2020-11-111-40/+221
| | | | | | | | Change the client code to store it by value. For the various find() and traverseEnum() functions, use a std::optional to replace the pointer. Change-Id: Ie4e671bf95e569741fa3c9a399bfe239ceac0dec Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Introduce a private class hierarchy for TypeEntryFriedemann Kleint2020-11-101-0/+2
| | | | | | | | | | | | | | | | | Move the data members of the TypeEntry classes to private classes, using convenience macros modeled after Qt's Q_D macro. The main motivation here is header hygiene and decoupling; typesystem.h was including a lot of classes. This requires moving some code around: - Move the debug formatting helpers of the TypeEntry classes from typedatabase.cpp to typesystem.cpp. - Move struct TypeRejection to typedatabase.h - Reorder typesystem.cpp in order of declaration. Change-Id: I24fe501d98940afd44caf75057cd6131cfbd6b6e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Split the abstractmetalang headers and sourcesFriedemann Kleint2020-11-061-0/+128
Split out enums, fields and functions. Only AbstractMetaClass remains in abstractmetalang.h. Change-Id: I49846f92fafc5969d83aa4a1767eb4ac23f39d1c Reviewed-by: Christian Tismer <tismer@stackless.com>