aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* shiboken6: AbstractMetaClass: Introduce a private classFriedemann Kleint2020-11-116-247/+538
| | | | | | | | | Move the data members of AbstractMetaClass to a private class. Similar to what was done for TypeEntry, the main motivation here is header hygiene and decoupling. Change-Id: I8e2ea551b5df29649ed6f93a8a4cb938ac1978f6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Port AbstractMetaEnum/Value to use QSharedDataPointerFriedemann Kleint2020-11-1130-464/+688
| | | | | | | | 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>
* shiboken: Ensure that `seterror_argument` always gets a function argChristian Tismer2020-11-113-5/+9
| | | | | | | | | | | | | | | | The call to the internal function `seterror_argument` is generated by cppgenerator for all generated classes. The constructor is special cased, so that for `SomeClass.__init__` only `SomeClass` is generated. For error handling, we should always see the failed function name, regardless of any convention. This has become a real problem with the new error handler written in C that can not easily deduce if a function or class is passed. Task-number: PYSIDE-1019 Change-Id: I073f8e866c6bbce5dd842ef4be5d6c6c5421db0f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyside6: make sure that class properties trigger feature switchingChristian Tismer2020-11-111-0/+1
| | | | | | | | There was a call to the switching function missing in the metatype. Task-number: PYSIDE-1019 Change-Id: Ia556e3c562006a267b6a0a16b68cd366981f5d2d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove <argument-map> and "associated-to"Friedemann Kleint2020-11-114-70/+1
| | | | | | | | | | The element <argument-map> appears to be related to code snippets, but it is neither documented nor used anywhere. The attribute "associated-to" is also unused. Change-Id: Ib567d5391d0ee5284db5a38db4a4e803bf569ef4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove unused header apiextractormacros.hFriedemann Kleint2020-11-113-43/+0
| | | | | Change-Id: I01a1f629727f176cb054bf1c7269b878b42b7c9f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Windows: Prevent cmake from auto-detecting the clang compilerFriedemann Kleint2020-11-101-0/+4
| | | | | | | | cmake tends to auto-detect the clang compiler from the path and then fails the build. Force it to use cl.exe. Change-Id: Ic58cc0e734dd42bba0ad383842ef73f23de50c76 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken6: Port AbstractMetaField to use QSharedDataPointerFriedemann Kleint2020-11-1021-201/+232
| | | | | | | | | | Fold AbstractMetaVariable into AbstractMetaField and use a QSharedDataPointer for it. Change the client code to store it by value. For the find() and traverseField() functions, use a std::optional to replace the pointer. Change-Id: Ibaa301b9aaae8851fcaa077327235cc5aaad7342 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Introduce a private class hierarchy for TypeEntryFriedemann Kleint2020-11-1028-1020/+1829
| | | | | | | | | | | | | | | | | 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: Fix inheriting template fieldsFriedemann Kleint2020-11-101-2/+3
| | | | | | | | | | | | | 562edc619787d83b2d4418fa7a69c597a7b6945c changing AbstractMetaClass::fields() to return const-ref introduced a bug causing inherited fields of the same name to be rejected since they were added to the list. Take a copy of the field list to fix this, similar to d72f0e35f22f3f9460d12e40f8f5676bf5a7f0d1 for functions. Change-Id: I4c7c4938dc4b3515a51ed0a161b4fc8c95d4f141 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Replace AddedFunction::TypeInfo by TypeInfoFriedemann Kleint2020-11-098-315/+153
| | | | | | | | | | | | | | | | | | AddedFunction::TypeInfo was a stripped-down version of the code model's TypeInfo with its own, simplified parser. Replacing it by TypeInfo allows for removing the parser code and the entire AbstractMetaBuilderPrivate::translateType(AddedFunction::TypeInfo) branch. The more powerful TypeParser from the code model can then be used, allowing for more complex types in <add-function> or <declare-function>. As a drive by, replace the AddedFunction constructor by a static factory function, allowing to pass up parse errors. Change-Id: I33ad19e9b5ed30bd27898afe771401ddc98c8c73 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Add a new parser for AddedFunction parametersFriedemann Kleint2020-11-094-1/+220
| | | | | | | | | | | Observe' <' (templates), '{' (initializer lists), '[' (array dimensions) and '(' (initialization, function pointers) when splitting the parameter lists of added functions. Add a test. Change-Id: I8cdc135a2daceab5587c4b5545ed38f0a022b5f8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Use QSharedDataPointer for class TypeInfoFriedemann Kleint2020-11-093-138/+367
| | | | | | | | Make it a bit more lightweight for usage in AddedFunction. Change-Id: Ia86ca5f77b907cc405993e202738d4e827bb1dbb Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove AbstractMetaAttributes::DocumentationFriedemann Kleint2020-11-097-19/+20
| | | | | | | | | It does not really belong there; also it was shadowed by AbstractMetaVariable::Documentation. Add it to the inheriting classes instead. Change-Id: Id50344f653b52fa8501162e600879bcc71cd5824 Reviewed-by: Christian Tismer <tismer@stackless.com>
* AbstractMetaFunction: Show whether a function is user-declaredFriedemann Kleint2020-11-092-0/+10
| | | | | | | Extends 40483a4249306b62029987d03e7de57d456954b2. Change-Id: Ia2f78e5804de973ae4e21e38fcbe3a55bc92a032 Reviewed-by: Christian Tismer <tismer@stackless.com>
* python3: remove all obsolete "from __future__" import statementsChristian Tismer2020-11-0953-99/+2
| | | | | | | | | | | Note that not all future statements can be removed: PEP 563 for instance deals with from __future__ import annotations Task-number: PYSIDE-904 Change-Id: Ia387ec87f3c68ca64d13e8e80191eda900f58638 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Fix inheriting template functionsFriedemann Kleint2020-11-071-2/+3
| | | | | | | | | | | 562edc619787d83b2d4418fa7a69c597a7b6945c changing AbstractMetaClass::functions() to return const-ref introduced a bug causing inherited functions of the same name to be rejected since they were added to the list. Take a copy of the functions list to fix this. Change-Id: I2f6182f45b13589f3495b1a4445c8004aadb4b95 Reviewed-by: Christian Tismer <tismer@stackless.com>
* signature: provide error messages for unsupported function typesChristian Tismer2020-11-061-2/+12
| | | | | | | | | | | | | | | | | | Since class properties are now developed, we now have the case that class methods can produce errors without having a valid signature, yet. Signatures for class methods will be implemented eventually. Before that happens, we provide a default error message which shows the given arguments. This is sufficient for the moment, because errors in class methods can currently be created by class property setters only which have a quite trivial signature. Task-number: PYSIDE-510 Change-Id: I6397da114cedd628ba19c86b153e60497a0b4ddd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* testrunner: Report the number of failed testsFriedemann Kleint2020-11-061-3/+7
| | | | | Change-Id: I0e5f73d7bf0bb404dc77d6d016a211e61c09da91 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Split the abstractmetalang headers and sourcesFriedemann Kleint2020-11-0649-2147/+2250
| | | | | | | | Split out enums, fields and functions. Only AbstractMetaClass remains in abstractmetalang.h. Change-Id: I49846f92fafc5969d83aa4a1767eb4ac23f39d1c Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Split out modification classes from typesystemFriedemann Kleint2020-11-065-970/+1016
| | | | | | | | Change Modification::Modifiers to be a QFlags and remove unused functions. Change-Id: Ia4a6b9ef06415275b33891cb04772780cd7f2d65 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build scripts: Fix warning about import orderFriedemann Kleint2020-11-052-11/+8
| | | | | | | | | | Import Setuptools before Distutils, fixing: distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first. Pick-to: 5.15 Change-Id: Ibbc1a5cd1d348f6f44f7e80a3ba7e9a7341fae8e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Further adaptations to Qt 6Friedemann Kleint2020-11-053-24/+9
| | | | | | | | | | | - Remove QPrinter::getPageMargins() - Fix qcollator test, adapting to qtbase/3a1bc4bad5757d72e5af8b4abe236e3cfac9621d. - Add new QShortcut constructor, adapting to qtbase/b26fa9722f9e8c81406259f6db8044e8bbc2d50b Change-Id: I92b2b54fbe5a93ac40a8ad69589f9317df03b4ad Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Move defaultValue from AddedFunction::TypeInfo to ↵Friedemann Kleint2020-11-053-13/+16
| | | | | | | | | | AddedFunction::Argument It does not really belong into the type. This makes it easier to merge CodeModel's TypeInfo and AddedFunction::TypeInfo. Change-Id: I38c947839e4dc785aad70e8636838db020f031d4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Split out class TypeInfoFriedemann Kleint2020-11-058-533/+598
| | | | | | | | | | This is the first step towards using it in AddedFunction as well, replacing AddedFunction::TypeInfo. Change list accessors to return const-ref on this occasion. Change-Id: I78a7be0b3cb738b859519b7fbff8ed024fb46106 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add changelog for 5.15.2Friedemann Kleint2020-11-051-0/+70
| | | | | | Pick-to: 5.15 Change-Id: I19aa4cb70be3d96aac9dbe74dad5adc4280fe6d1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix QAxBase::dynamicCall(const char *, QVariantList)Friedemann Kleint2020-11-031-1/+7
| | | | | | | | | | | | | | | | When invoking QAxBase::dynamicCall(const char *, QVariantList), the overload taking single QVariants QAxBase::dynamicCall(const char *, QVariant1, QVariant2,...) was chosen by the overload decisor since QVariantList can be converted to QVariant. Specify the order manually. Remove the internal protected function. Pick-to: 5.15 Fixes: PYSIDE-1410 Change-Id: I1bcffd34486d5ceebdeea3af47f42398896e9575 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Build scripts: Switch to Qt 6Friedemann Kleint2020-11-024-15/+15
| | | | | Change-Id: I40ba653f38bf079a697f0a509300a87e45181c30 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix the Windows buildFriedemann Kleint2020-11-021-1/+1
| | | | | | | Amends 559c56b140410bcfa0ce6f19b47d1ba0daa9a201. Change-Id: I1e41dcf0b4bf52d84a16a02b995cc9d7ec9c15f7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-022575-84262/+84262
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* replace **locals by f-strings where possibleChristian Tismer2020-11-0217-88/+82
| | | | | | | | | This change affects mostly only my own sources which were prepared for the migration to Python 3.6 . Task-number: PYSIDE-904 Change-Id: I0c2cd59f6f625f51f876099c33005ac70ca39db9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Binding Example helpers: Remove version numbersFriedemann Kleint2020-11-0210-210/+219
| | | | | | | | - Rename the scripts - Introduce variables for the versions in pyside_config.py Change-Id: I1dcb8ca7eee259f25af0db7c09abd30484c7e99c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* build scripts: Introduce variables for the versionsFriedemann Kleint2020-11-029-71/+122
| | | | | Change-Id: Iac73fcf6e60f882968463d1c612f5ca5dc206222 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Examples: Remove utils.pyFriedemann Kleint2020-11-026-68/+15
| | | | | | | It is no longer required for Python3. Change-Id: I5cbdcae5273e59e494c61319fe986c4611dbab97 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Remove version suffixes from the example documentationFriedemann Kleint2020-11-027-14/+14
| | | | | Change-Id: Ia59b552467a58c1e7b791f5cafee571cd3c867bb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6 tests: Consolidate import/export macrcosFriedemann Kleint2020-11-024-51/+46
| | | | | | | | Following 430d02db24b95a56ae0acc6a9df6a0effe49da0d, base them on libminimal. Change-Id: I722a73e6f45344cbc91fb044bdf1f015bdff5ec2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Clean up PySide2/global.hFriedemann Kleint2020-11-021-11/+1
| | | | | | | | After 62c21af778b7bff6c86e7f89ef03a87efa6c51cb, the annotation defines for Qt are no longer required. Change-Id: Ib3746257992073850a324fb1de77a484aa36d6b6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Remove old pyside2-tools directoryCristian Maureira-Fredes2020-10-312-1/+1
| | | | | | | | | | | | The tools directory was brought back as sources/pyside-tools and currently only holds the pyside_tool.py script to create the entry points for rcc and uic. Since the submodule is not present anymore, we remove also the reference from the testing step. Change-Id: I0bfa4509d44c9bd2a3e5fbf4ddb7fff7a2750f4d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Declare some missing functions in QListFriedemann Kleint2020-10-302-4/+13
| | | | | | | | | | | | | | | | QList<T> member functions taking a T parameter are no longer seen by the code parser since they take a parameter_type which is specialized to be T or const T & depending on T. Declare them instead. Similar, change QPolygon::operator<<(T) to add-function. This fixes several PySide tests that rely on those functions (qpolygon and others). Task-number: PYSIDE-904 Task-number: PYSIDE-1339 Change-Id: Ic1157f384f86b796cc5c7bc06a934a63649d74be Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Enable declaring functions on container typesFriedemann Kleint2020-10-301-1/+5
| | | | | | | | | | Give the type a parse stack entry. Previously, they ended up in the global functions. Task-number: PYSIDE-904 Task-number: PYSIDE-1339 Change-Id: Ie62dbc0e21ff4c81ef22f98973ab20c3cd85e03a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add element <declare-function>Friedemann Kleint2020-10-307-11/+62
| | | | | | | | | | Make it possible to simply declare functions that the code parser cannot see. Task-number: PYSIDE-904 Task-number: PYSIDE-1339 Change-Id: If50bc0f1fc77a63e753b6fa440e6f08dd312ce4c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Consolidate argument type parsing of added functionsFriedemann Kleint2020-10-302-62/+73
| | | | | | | | | | | | | | | | | Use the same functionality that is used for argument type parsing of functions from the code model, which has a more powerful type search. This will for example enable specifying class template arguments (like QList::append(T)). Move the error handling from translateTypeStatic(TypeInfo,...) to the findTypeEntries() function, extracting a helper for the search, and use this in translateType(AddedFunction::TypeInfo,...). Task-number: PYSIDE-904 Task-number: PYSIDE-1339 Change-Id: I34428d76e811c3b1444a4d2ded0606e67c4dcf57 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* TestRunner: Fix syntax errorFriedemann Kleint2020-10-291-1/+1
| | | | | | | Amends b78e5bd771f0d5a81692bc95f76929b092edf2f6. Change-Id: Idecff944c27c9473cd565224547a206199af8a30 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix the C++ - based examples to workFriedemann Kleint2020-10-294-16/+21
| | | | | | | Adapt CMakeList.txt, fix includes. Change-Id: Idc9636bee798c4a025b70f91b8379a9b9c79a82c Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide2: Fix the doc buildFriedemann Kleint2020-10-281-4/+12
| | | | | | | | | | QT_INCLUDE_DIR obtained from Qt6::Core's INTERFACE_INCLUDE_DIRECTORIES contains a ';'-separated list of directories, which caused the shiboken doc run to fail. Iterate over the list to determine the root include directory. Change-Id: I5c639b59fc614e92430999fdbb800063131f7d6d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* testing: remove __future__ and Python2 referencesCristian Maureira-Fredes2020-10-288-28/+5
| | | | | | Change-Id: I80079d8a0956e3cc9b27ceb5b5ea2cfc6c9c9449 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: Remove Python 2.7 and <3.6 related codeCristian Maureira-Fredes2020-10-2822-66/+10
| | | | | | | | | | * removing from __future__ import ... * updating CMakeLists.txt files * removing special if-else for Python 2 and 3 Change-Id: I8a34b06b6b384ebc5323f20f7c15c357a5be6d62 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyside/doc: remove python 2 referencesCristian Maureira-Fredes2020-10-287-30/+8
| | | | | | Change-Id: Ife968831c695f1982f9d0ed1157f9128331a700e Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken2: Handle operators written as hidden friendsFriedemann Kleint2020-10-284-9/+76
| | | | | | | | | | | | | | | qtbase/f7f1a71ea41579c1ff86c08c16b82e4c84bc891f changed some operators to be hidden friends, which causes them to become invisible. Detecting them requires parsing friend declarations and turning on parsing of function bodies for clang_isCursorDefinition() being able to tell a definition. Fixes a number of tests failing (qlinef_test, qsize_test, repr_test, unaryoperator_test). Change-Id: I4d3107181b942efebd785cfae7c3fd1b6f0963ac Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* doc: move setup.py docs and updatesCristian Maureira-Fredes2020-10-285-295/+290
| | | | | | | | | * Moves the huge docstring from setup.py to the README.md file, * Adding README.cmake.md as a new section of the README.md file, * Update versioning and do partial updates respect to Qt 6 Change-Id: I4d97f14ebcc1e17fe349aaf5c68b4ce4505c882f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>