aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-28725-388/+388
| | | | | | | | 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>
* shiboken2: Add location to error messages about added functionsFriedemann Kleint2020-10-283-6/+16
| | | | | Change-Id: I39210642a96e98328d193f4e81ecad82b496d6c9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* remove traces of Python2 from C codeChristian Tismer2020-10-2719-465/+5
| | | | | | | | | | | | It will be assumed that Python is always Python 3. All checks for Python 2 are removed. This is the second part of cleaning up the C code from references to Python 2. Task-number: PYSIDE-904 Change-Id: I3006412c2a5bb65402101b0aac5a5f2fc79ce2f8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* remove traces of Python2 from Python codeChristian Tismer2020-10-2713-69/+17
| | | | | | | | | | | | It will be assumed that Python is always Python 3. All checks for Python 2 are removed. This is the first part of cleaning up the Python code. We will then also clean the C code. Task-number: PYSIDE-904 Change-Id: I06050a8c1a18a19583f551b61775833a91673f4e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* build_scripts: remove references to python 2Cristian Maureira-Fredes2020-10-277-68/+24
| | | | | | | | | * Removing all the special cases for Python 2.7 * Removing Python >=3 conditions * Keeping Python 3.6+ as the allowed Python Change-Id: Ie48cafe952ae7a11bea997da2a35e7df5fea9a44 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup: remove ez_setup and update requirementsCristian Maureira-Fredes2020-10-273-386/+3
| | | | | | | | * Removing ez_setup since we will have Python 3 only * Updating requirements.txt to exclude Python 2 special cases Change-Id: I6ff5e3f6eba76a6e9726f01840e67316e786d450 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build_scripts: Fix the make_path error messageChristian Tismer2020-10-271-2/+3
| | | | | Change-Id: I32bfdfb728b39609ce4a63a6554ef0a3db58b122 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove deprecated QVariant::TypeFriedemann Kleint2020-10-272-47/+0
| | | | | | | | | Usage of the enum causes deprecation warnings. In addition, it is not clear why the type was there given that QVariant is not exposed. Remove the converters. Change-Id: I5b1f12ee0f869a63e6b7d82afdcb58a5d7062ce6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Bump the version.py filesFriedemann Kleint2020-10-272-4/+4
| | | | | Change-Id: I0e84b56ce354f3c88cb05a5818e80a28210d888b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* feature-select: implement class propertiesChristian Tismer2020-10-2710-22/+387
| | | | | | | | | | | | | | | | | | | After implementing property objects for PySide, the static properties (properties for static functions) were quite missing, for instance from QtCore.QCoreApplication and QtWidgets.QApplication . This implementation uses the normal Python properties and derives a PySide.ClassProperty class which works almost the same on classes. The static methods had to be mutated to class methods explicitly. That would be automated by PyType_Ready, but here we are doing this after class initialization. Task-number: PYSIDE-1019 Change-Id: Iabe00be18e25881cc7a97507b6fdae3e2d57ff7a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken2: Add a disable-wrapper attribute for complex typesFriedemann Kleint2020-10-274-1/+21
| | | | | | | | | Make it possible to disable the generation of a C++ wrapper in case that poses some problem. Task-number: PYSIDE-1202 Change-Id: Id0d557e4d4a57cf537be8fb398161aea3a16e174 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Remove version suffix from generators directoryFriedemann Kleint2020-10-2710-5/+5
| | | | | | | | It does not make sense to move it around in each major version. Task-number: PYSIDE-904 Change-Id: If83b1dcaf04ed5a76f35073aa63c7ef6b456936a Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: AbstractMetaArgument: use QSharedData[Pointer]Friedemann Kleint2020-10-2729-458/+647
| | | | | | | | | | | | | | | | | | | | Similar to AbstractMetaType, AbstractMetaArgument was previously kept as a raw pointer. The data were copied numerous times by AbstractMetaArgument::copy() when adding the inherited functions to a AbstractMetaClass. Similar to what was done for AbstractMetaType in 6cad0686101b252cfdbd1a6768a2b02c39aa1d8a, change the type to be based on QSharedData[Pointer]. It can then be passed around and treated like a C++ value type, with Qt sharing the data when possible behind the scenes. * Remove inheritance from AbstractMetaVariable by moving the fields over. * Remove the unused field m_originalName. Change-Id: Ic9e476ca71e163de131fbecc267d0a4e336cb0b9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide snippets: Fix deprecation warnings about constructing a QVariant from ↵Friedemann Kleint2020-10-271-34/+28
| | | | | | | | | a type id Rewrite the helper QVariant_resolveMetaType() to return a QMetaType. Change-Id: Ifa3994ea0c23149bd925e4a422f19e98e742d97f Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Fix deprecation warnings about constructing a QVariant from a type idFriedemann Kleint2020-10-272-5/+5
| | | | | | | | | Build the QVariant from the QMetaType, fixing warning like: libpyside/pysidemetafunction.cpp:186:64: warning: ‘Type’ is deprecated: Use QMetaType::Type instead. [-Wdeprecated-declarations] /libpyside/pysidemetafunction.cpp:186:77: warning: ‘QVariant::QVariant(QVariant::Type)’ is deprecated: Use the constructor taking a QMetaType instead. [-Wdeprecated-declarations] Change-Id: I5c9c4d775ef58ecf17326c112c5130c43fe1a09b Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Split out class DocumentationFriedemann Kleint2020-10-275-76/+148
| | | | | | | It is required for further refactorings. Change-Id: Ied5c73494546f3345cc76d2c9f1a808b7c5ee1e0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Fix a potential crash in debug operator of AbstractMetaTypeFriedemann Kleint2020-10-271-0/+4
| | | | | | | Bail out on invalid types whose type entry is 0. Change-Id: I088c6f2d3374603266c3804279152e468a754312 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Improve error messages about cyclic dependenciesFriedemann Kleint2020-10-277-25/+55
| | | | | | | | | | Return a struct instead of a plain list from Graph::topologicalSort() which contains the offending indexes and output the elements in case of failure. Task-number: PYSIDE-1202 Change-Id: Ib7f70c78be0e84272f31d802677c7fc333aa32f4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Handle typedefs of template parameters within templatesFriedemann Kleint2020-10-271-11/+47
| | | | | | | | | | | | | | | | | | Typedefs of template parameters like template <class T> class QList { using reference = T&; are reported as "type-parameter-0-0" by clang. Resolve that to the proper name of the template parameter in the clang builder. Also, these typeinfo results must not be cached since the same CXType is used for parameters of unrelated templates. Rename the createTypeInfoHelper() function to createTypeInfoUncached() for clarity and introduce a cacheable parameter. Change-Id: I2b21a4dfdd8d86cf36497832837c21f37cb86518 Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup.py: Make ninja the default generatorFriedemann Kleint2020-10-261-2/+2
| | | | | | | | It is recommended for use with Qt 6. As a drive by, fix invalid parameter in error message. Change-Id: I7d01a2b70b9033fa827f34fffece0368c1a5462a Reviewed-by: Christian Tismer <tismer@stackless.com>
* pysideproperty.cpp: Fix warning about offsetofFriedemann Kleint2020-10-261-13/+15
| | | | | | | | | Return the functions directly, fixing (g++ 9.3.0): sources/pyside2/libpyside/pysideproperty.cpp:331:42: warning: offsetof within non-standard-layout type ‘PySidePropertyPrivate’ is conditionally-supported [-Winvalid-offsetof] Pick-to: 5.15 Change-Id: I98f57d05c4c4163e06431c579537b4db01c656e6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove wheel.pep425tags importsCristian Maureira-Fredes2020-10-262-19/+20
| | | | | | | | | | | The import was removed starting from v0.35 in favor of the packaging module and other functions that are not placed in 'bdist_wheel'. Pick-to: 5.15 Fixes: PYSIDE-1385 Change-Id: I97f5dbf9867f779a897d9041489831255ea54b67 Reviewed-by: Simo Fält <simo.falt@qt.io>
* shiboken2: AbstractMetaType: use QSharedData[Pointer]Friedemann Kleint2020-10-2338-1682/+1917
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, shiboken2 kept AbstractMetaType by a raw pointer. The data were copied numerous times by AbstractMetaType::copy() when adding the inherited functions to a AbstractMetaClass or specializing templates, sometimes with a bool flag indicating ownership. To get rid of the copies and ownership issues, change the type to be based on QSharedData[Pointer]. It can then be passed around and treated like a C++ value type, with Qt sharing the data when possible behind the scenes. - Extract AbstractMetaType to a separate header/source - Remove unused AbstractMetaType::setInstantiationInCpp() - Remove unused member m_package - Rewrite the comparison of AbstractMetaType which becomes relevant for checking/detaching to do a complete comparison. It was previously unused, intended for a different implementation of view types with special cases. - Rework debug formatting - Invalid meta types are indicated by the "Invalid" usage pattern instead of null pointers Change-Id: Ic4b1feecafb4f0355f39e178c2703b104e45cf6c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QtQml: Implement QmlElementMaximilian Goldstein2020-10-226-4/+130
| | | | | | | | Equivalent to QML_ELEMENT in C++, this enables users to register classes for use in QML by using the QmlElement decorator. Change-Id: I697e486ef58b18cce4c310e4b556e28735a16d45 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-224-4/+113
|\ | | | | | | Change-Id: I68ec1e4b80fcc8c395eacb7d5046fdd8e00535e0
| * Update SmartPointers conversionsRenato Araujo Oliveira Filho2020-10-214-4/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | * Updated test to accept base types derived using std::shared_ptr; * Generate new coode to be able to convert smart pointers into shared pointers of base class. Functions that accepts SharedPointer<A> as argument should be able to accept SharedPointer<B> if B is derived from A. Task-number: PYSIDE-1397 Change-Id: I7e5235980daaf4651dad3ab1c880373f1c64e134 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-2119-247/+309
|\| | | | | | | Change-Id: I8831b840fa7816b8919ecbaab17b41822a0a6012
| * Add some missing enumerations and classesFriedemann Kleint2020-10-215-1/+8
| | | | | | | | | | | | Task-number: PYSIDE-487 Change-Id: Ic5d15d67b821eff5cb59727ce2d749e6aa848441 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Fix SmartPointer conversion name registerRenato Araujo Oliveira Filho2020-10-211-11/+30
| | | | | | | | | | | | | | Register the correct name for smart pointers. Change-Id: If12701901319b0578602ff5b5ab8eecad820d969 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>