aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample
Commit message (Collapse)AuthorAgeFilesLines
...
* shiboken6: Add tests for the std::string conversionFriedemann Kleint2021-09-292-0/+7
| | | | | | | Task-number: PYSIDE-1660 Task-number: PYSIDE-1666 Change-Id: I1190a0ae074401f7db8883d83b51d2db79ba708f Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Add test for default constructorsFriedemann Kleint2021-07-292-6/+2
| | | | | Change-Id: I338599754bcc96d6bd3ca3b0b58eb953b36580e4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Add support for operator boolFriedemann Kleint2021-07-022-0/+49
| | | | | | | | | | | | | | | | [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: Add test for constantsFriedemann Kleint2021-06-181-0/+2
| | | | | | | Task-number: PYSIDE-186 Change-Id: Ic4ba7f22bead8418a18dec100a77e3befe038a76 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Fix increment/decrement operatorsFriedemann Kleint2021-06-095-9/+151
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* libpyside: Fix some clang analzyer warningsFriedemann Kleint2021-03-111-1/+1
| | | | | | | | | | | | - 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>
* shiboken6: Brush up the test code with regards to iteratorsFriedemann Kleint2021-03-119-66/+50
| | | | | | | | Use algorithms, range-based for and auto to streamline some of the test code. Change-Id: I312ebc340ce0d02dd4ed3e0fca8e2cf6b645b69a Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Add constructors of base classes imported via "using"Friedemann Kleint2021-03-015-0/+174
| | | | | | | | | | | | | 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>
* Clean up some warnings produced by Qt Creator's clang/clazy code checkersFriedemann Kleint2021-01-211-0/+2
| | | | | | | | | | - Remove unused variables - Remove assignments that do not have any effect - Fix mixing const/non-const iterators - Fix for loops, use const ref and/or qAsConst() Change-Id: I4b52f11030493c440026b194f18ec0151a3ea710 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add support for a snake case typesystem attributeFriedemann Kleint2020-12-073-0/+135
| | | | | | | | | | | | | Add a snake case attribute to type system, complex type entry, function type entry as well as to function and field modifications. Add a function definitionNames() to AbstractMetaFunction/Field returning the names under which the function/field will be registered. Change the code writing the registration accordingly. Fixes: PYSIDE-1441 Change-Id: I178390bb80fa25aad9f8a56e99e4cc70064178eb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Fix field modificationsFriedemann Kleint2020-12-022-1/+3
| | | | | | | | | | | | | | | The logic was only partially present, neither removal of getter/setter nor renaming had any effect. Rewrite the code to resemble that of AbstractMetaFunction (adding function applyFieldModifications()) Move some check functions from the generators to AbstractMetaField/Type. Add tests in libsample. Change-Id: Ib29d4e37db51f122b46702cb5d96b13da6d0f224 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6 tests: Consolidate import/export macrcosFriedemann Kleint2020-11-021-13/+10
| | | | | | | | Following 430d02db24b95a56ae0acc6a9df6a0effe49da0d, base them on libminimal. Change-Id: I722a73e6f45344cbc91fb044bdf1f015bdff5ec2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-28121-0/+10215
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>