aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* CI: Disable wheel testerSimo Fält2020-12-081-1/+2
| | | | | | | | Wheel tester keeps failing constantly, so this disables it to allow enabling ci. Change-Id: Ia188d92808a2877fa1e972cff5cfb0822fa7392c Reviewed-by: Christian Tismer <tismer@stackless.com>
* Qt CI: Install libCLang 10.0Simo Fält2020-12-083-0/+70
| | | | | | | | Qt 6.0.0 CI configuration includes only static version of libClang so we need to install dynamic libs ourselves to be able to run shiboken6. Change-Id: I7654f9ac111c0dc2bfb78b3b3f3acb49b159925c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Remove unused attribute from qtxmltosphinx.cppFriedemann Kleint2020-12-081-1/+0
| | | | | Change-Id: Icf83ad1a2d4784dd09b4bba16093b2f67c2e77da Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Add support for a snake case typesystem attributeFriedemann Kleint2020-12-0725-33/+625
| | | | | | | | | | | | | 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>
* testing: Add a "ci" keyword equivalent to the one in QtFriedemann Kleint2020-12-031-0/+2
| | | | | | | COIN-only failures can then be tagged accordingly. Change-Id: Ib7f5abaea48eee5feee5b676ba80421c66ffb08e Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Use a QSharedDataPointer for ArgumentModificationFriedemann Kleint2020-12-0310-131/+323
| | | | | | | | | For reasons of consistency and header hygiene. As a drive by, remove unused argument modification replace-value. Change-Id: I44d0a244c89f2bf10242544111d23e072df3b480 Reviewed-by: Christian Tismer <tismer@stackless.com>
* fix both qflags_test and the qflags cppgenerator codeChristian Tismer2020-12-033-9/+10
| | | | | | | | | | | | | | | | | | There was a years-old qflags test failing on Python 3. It was blacklisted with the comment "# Nested exception in Python 3" This was nonsense: The test was wrong also for Python 2. It just happened to work, because Python 2 had some weird errors leaking. The real bug was in missing error handling in cppgenerator.cpp . See the main description in the issue. Change-Id: Ia0f9466640e0eb33f1b8b26178d33f2be0bcb32f Task-number: PYSIDE-1442 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add Qt6 install bin to PATH when running CI instructionsSimo Fält2020-12-031-0/+14
| | | | | Change-Id: Iceb4c929dc56778c3473156bc3d8680a5cf10eba Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* test: fix QtQml::signal_argumentsCristian Maureira-Fredes2020-12-021-1/+1
| | | | | Change-Id: Ie554c42597343d10cf199739d6821b6cb40894bc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* PySide6: Fix ownership issue in QLayout::replaceWidget()Friedemann Kleint2020-12-021-0/+4
| | | | | | | | | Use the standard ownership code for QLayout for the new widget. Fixes: PYSIDE-1432 Pick-to: 5.15 Change-Id: I441e1e72e18cdd3b9b942f6810fd399f266de748 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Simplify handling of removed attributeFriedemann Kleint2020-12-029-90/+57
| | | | | | | | | | | | The meaning of the TypeSystem::Language enumeration value on the remove elements was unclear; and it is only ever used with 'all'. Replace it by a boolean value and simplify the code accordingly. Adapt the documentation. Change-Id: I82d082e6d551403642936294a11abbac09d723dd Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Refactor field modificationsFriedemann Kleint2020-12-029-42/+119
| | | | | | | | | | | Decouple class FieldModification from the base class Modification since it does not need its attributes and turn in into a value class using QSharedDataPointer for consistency with FunctionModification. Remove some unused code and simplify removed handling. Change-Id: I9997559acd529bd070df5ff84610fe75c74a71a5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Remove deprecated typesystem tagsFriedemann Kleint2020-12-028-177/+62
| | | | | | | | | | | <remove> and <access> were deprecated in favor of attributes on the functions in PySide2. Similarly for <rename>, but it is still used as a child of <modify-argument>. Leave this usage in place, but add parsing of the rename attribute to <modify-argument>. Change-Id: I8e80ba13a3e4af1df0448bd0de034d242a9fdeb4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build scripts: Import 'PYSIDE' for linux platformSimo Fält2020-12-021-1/+1
| | | | | Change-Id: I08b665ae4feccc9b22b45da999150188228f29e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Fix field modificationsFriedemann Kleint2020-12-0211-44/+124
| | | | | | | | | | | | | | | 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: Use initializer lists for the converter replacement regexpsFriedemann Kleint2020-12-012-17/+28
| | | | | | | Complements 28aa3c4f6605a6331b12f47e03a9aba4aaefe201. Change-Id: I2814ce4832a6cf7623abb9e6e290773377795565 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove dependencies.yamlSimo Fält2020-12-011-4/+0
| | | | | | | | | We are now using whole Qt as a dependency, there is no need for file listing individual modules. Change-Id: I3b8a7788d3629e7325a96787c9053db2f0de44b2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Remove unused variable from ↵Friedemann Kleint2020-12-011-3/+0
| | | | | | | CppGenerator::writeMethodWrapperPreamble() Change-Id: I954d1ec8a460fd62979ed605288995a65de2e7f9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Fix some functions to take a const AbstractMetaClass *Friedemann Kleint2020-12-014-23/+23
| | | | | Change-Id: Iccee5cab96362250997daf39a354ddc7e8ab2909 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Use initializer list for operator mapping in doc generatorFriedemann Kleint2020-12-011-34/+36
| | | | | | | Complements 28aa3c4f6605a6331b12f47e03a9aba4aaefe201. Change-Id: I8194dccd94dc4a6fbac11a874fd18b60f7aa1533 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Store AbstractMetaFunction using a QSharedPointerFriedemann Kleint2020-11-3051-760/+724
| | | | | | | | | | | | | | | | | | Store the list functions (global / class member) as a QList<QSharedPointer<const AbstractMetaFunction> instead of a raw pointer list. This makes passing around function lists easier and solves the memory leaks caused by mixing cloned and unmodified functions while collecting the overload lists in the generators. - Change the function signatures accordingly - Add a qSharedPointerConstCast() for non-const access. - Restructure the traversing of added functions in the AbstractMetaBuilder - Remove some unused typedefs and functions unearthed by the change Change-Id: I08a6c5243750e3eb3813bc3f7172899ad2b13e22 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Adjust accepted CI configs for QtForPython version 6Simo Fält2020-11-301-28/+17
| | | | | Change-Id: I29dcee812fe15cdc05403eb9ce7146a1bad85dcf Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Remove python2 build and test calls from CI scriptsSimo Fält2020-11-302-20/+13
| | | | | | Change-Id: I3933c92905bc83e2d59f368c2c7fd5380408b1c8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Pin numpy as 1.19.3 for windowsSimo Fält2020-11-302-1/+4
| | | | | Change-Id: I244198d9ea878c6c4f976cb0080842dd023d2941 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Allow calling CI's build scripts with python2Simo Fält2020-11-301-1/+7
| | | | | | | | | Currently we can't be sure that python3 is a default python in all CI nodes. Change-Id: I58ba7d2bb2dd987d344709c296ee3c5bc5c9c376 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use Qt6.0.0 as a dependency for CISimo Fält2020-11-301-0/+3
| | | | | Change-Id: Ib54260658ecdce99df1ff6a3984f85306c4b81ad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* signature: avoid duplication of `__init__`Christian Tismer2020-11-301-1/+2
| | | | | | | | | | | | | | After the reworking of error messages, the `__init__` function became visible both via the "class" and as "class.__init__". The constructor is treated specially because we want to list it first. Avoid duplicate generation of the constructor by filtering in "enum_sig.py". Change-Id: I04c0a47990d6ca8d97a748f7ecfe911f9aec2fe6 Task-number: PYSIDE-1305 Pick-to: 5.15 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Replace handler map in QtXmlToSphinx by an enumerationFriedemann Kleint2020-11-302-85/+242
| | | | | | | | | | | Constructing the strings and populating a hash with function pointers for each invocation on a snippet is wasteful. Introduce an enum, populate a constant static hash with it and dispatch the call via switch. Change-Id: Ia8e0123fc31802c35b33308edb0fa9edc6add775 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* cppgenerator: rework keyword handling regarding unknown.. augmentedChristian Tismer2020-11-301-4/+1
| | | | | | | | | | | | | The new keyword algorithm did fail on Windows. There was a wrong calculation of the number of arguments left over from the old algorithm. This was only visible on windows, because it generates slightly different signatures for QtGui.QColor. Change-Id: I5aee3e7c722c8365f86bf6196ab1fd3cf5bb46ad Fixes: PYSIDE-1305 Pick-to: 5.15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Clean up member variables of the generatorsFriedemann Kleint2020-11-305-344/+366
| | | | | | | | | | | | | | | | | | | | | | There used to be a lot hash/list member variables in the generators, some of them static. Refactor this to: - Use initializer lists. - Introduce static functions returning a const ref to const hashes and lists and put them closer to where they are needed. - Move m_tpfuncs to cppgenerator. - Introduce a special struct for protocol function entries for clarity. As a drive by. streamline and fix CppGenerator::writeTypeAsMappingDefinition(), CppGenerator::writeTypeAsNumberDefinition() to generate nullptr and reinterpret_cast and not populate hashes with empty strings. Change-Id: Id1d067dec7769568f56b77ccafca843e01f99b0b Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Fix linker error about void TextStream::putCharHelper(char)Friedemann Kleint2020-11-272-2/+12
| | | | | | | | Move the TextStream::putChar() functions into the source file so that it sees the putCharHelper() template. Change-Id: If5ed7bfc2e1b36f1767e09f8306ddc0a9c7f834f Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Remove namespace QtQmlFriedemann Kleint2020-11-273-5/+1
| | | | | | | | It was removed in qtdeclarative/5a59cbfee71907c47587a1e3d340d31abfdc01ba. Change-Id: I94c49dced3decb9089c1f8745468d080e0d0311d Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Fix test javascript_exceptions.pyFriedemann Kleint2020-11-272-3/+1
| | | | | | | It was using the old Qt Quick Controls 1. Change-Id: Ia1d6a884267fdcd8e3808b08bf1efa12eb62b4dd Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6/QtQml: Fix compilation with new QMetaTypeInterfaceFriedemann Kleint2020-11-271-3/+9
| | | | | | | | | After qtbase/b4c17476129e07dd3bf52c6aac8a51cf30c2dd3a, a function returning the QMetaObject * is required. Task-number: QTBUG-88468 Change-Id: I2d957ff97a2bfa04578873ce098b1e623edf759a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* property: fix an eight year olde bug that showed after the overhaulChristian Tismer2020-11-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | The modernisation of pysideproperty.cpp creates an error when using @Property(str, constant=True) This could also be provoked before the improved version of Property by def getVal(self): return self.val variable = Property(str, getVal, constant=True, fset=None) because the None/NULL - handling was incomplete. Change-Id: Ib39dd3bdb62ba928164faa465ee3dd743262e245 Fixes: PYSIDE-1426 Pick-to: 5.15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pysideproperty.cpp: Fix compilation with MSVC2019/C++ 17 modeFriedemann Kleint2020-11-261-7/+6
| | | | | | | | | It does not accept a ternary operator with QByteArray/const char * arguments. Pick-to: 5.15 Change-Id: I02bcb740100c4568ecb262fa6ecf3d466e02c875 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Fix generation of protected enums without protected hackFriedemann Kleint2020-11-261-0/+2
| | | | | | | | The cast was no longer generated due to a bug in Amends3ec934419b1217e2a623e2f91336a8a5628ec5fe. Change-Id: I27bb554ae24bedf2625654409d8b9b365b47c3c1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Remove macro SbkDbgFriedemann Kleint2020-11-267-137/+6
| | | | | | | | | | | | | SbkDbg was a macro modeled after QDebug which produced some colored output on a terminal. It was (wrongly) used only in one place which caused a MSVC warning about missing macro parameters. Replace it by PyErr_WarnEx(). Change-Id: Ie0a134c864d8f434c7acefb22dac715012f36238 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Build with MSVC 19.28.29334Friedemann Kleint2020-11-261-15/+28
| | | | | | | | | Use clang builtin-includes. Pick-to: 5.15 Fixes: PYSIDE-1433 Change-Id: I91c87f8ff764d126acf4bb6aa564c515e61ab0a4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken6: Port QtDocGenerator to the new text streamFriedemann Kleint2020-11-266-294/+156
| | | | | | | Finally remove the old indentor. Change-Id: I25150f61f914c1a6adc13341057a94c8bd281296 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6/TextStream: Fix output of empty aligned fieldsFriedemann Kleint2020-11-263-1/+16
| | | | | Change-Id: I1cc8c2b174dd7428def2a2b4ac7f84f5b6aa1df3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix sphinx warning in QtCore.Property.rstFriedemann Kleint2020-11-261-0/+1
| | | | | | | | | Fix doc/rst/PySide6/QtCore/Property.rst:3: WARNING: Explicit markup ends without a blank line; unexpected unindent. Pick-to: 5.15 Change-Id: I20311655899df17313aa657c0b93c9d488f3b5c8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Replace QVector by QListFriedemann Kleint2020-11-2545-175/+174
| | | | | | | | | | | | | | | | Change AbstractMetaClass::templateArguments() to return TypeEntries (const TypeEntry *) instead non-const. Remove redundant typedef OverloadData::MetaFunctionList. Use existing typedefs in some places. Add new typedefs for MetaObjectBuilder::EnumValues and AbstractMetaFunctionCList. Change-Id: Ia241b5fbe54d60ea57175fb1f6c844604e066a3d Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Split out the QtXmlToSphinx formatter from the doc generatorFriedemann Kleint2020-11-256-1558/+1685
| | | | | Change-Id: I9b8ef4c53234d107e394c0a1396c8ed00768d722 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken6: Introduce a new Text streamFriedemann Kleint2020-11-2520-1774/+2121
| | | | | | | | | | | | | | | | | | | Add a new text stream wrapping QTextStream with built-in indent. This removes the need to have INDENT as a separate member variable or function parameter and to output it at the beginning of each line. It also makes it easier to factor out the write() functions since they no longer need the indent. Make the write* functions const where possible. The doc generator is left as-is for the moment. Rename the old Indentation to Indentation4 to avoid conflicts. Change-Id: I6866e7360df119859adeee567d2b18a37cb63a79 Reviewed-by: Christian Tismer <tismer@stackless.com>
* errorhandler.py: use AttributeError instead of TypeErrorChristian Tismer2020-11-252-2/+2
| | | | | | | | | | | | | | There is a small improvement needed in errorhandler.py: It was not consequent to use TypeError for missing attributes in one case, and to use AttributeError on the constructors. The error message may be different, but it always should be AttributeError. Task-number: PYSIDE-1305 Task-number: PYSIDE-1019 Change-Id: I1c278c5256000f0f0fe66ca9da36c2d078002b25 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Refactor writing out filesFriedemann Kleint2020-11-243-2/+15
| | | | | | | | | Write the buffer directly to the file instead of reopening the text stream on it (which has unclear encoding semantics). Add error handling on this occasion. Change-Id: Ifd478f96a73dbc21e441fed8b8e543f07b6fa00b Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup.py: Fix 'clean' commandFriedemann Kleint2020-11-241-1/+6
| | | | | | | | | | | Do not add -reuse-build, which it cannot handle. Amends ff5a96c49e2aa5347c1c9892aad33c591e931639. Pick-to: 5.15 5.15.2 Task-number: PYSIDE-807 Change-Id: I96ab03b95dd7762b1a16f2acc5d8ca31555ef1a3 Reviewed-by: Alexander Volkov <avolkov@astralinux.ru> Reviewed-by: Christian Tismer <tismer@stackless.com>
* cppgenerator: rework keyword handling regarding unknown keywordsChristian Tismer2020-11-2312-89/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | PySide has a distinction between functions with simple arguments and functions with keyword arguments for optional keywords. When a function has keywords specified in one or more signature branch, it gets the METH_KEYWORDS flag. In this case, it is checked that no argument is given positional and per keyword at the same time. Completely forgotten was to check which keywords are allowed in that branch, if at all. The problem was much complicated because constructors can contain extra signals and properties. At the same time, all further error messages are generated with Python. This adds necessary flexibility when features are active. All PyBuildValue objects were refcount leaking. That has been replaced by static createStaticString expressions. The `argNames` structure is no longer needed by the improved algorithm. Change-Id: Ic297912c47231720f61c7d4b79b46a1e376a9941 Fixes: PYSIDE-1305 Task-number: PYSIDE-1019 Pick-to: 5.15 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Replace QScopedPointer by std::unique_ptrFriedemann Kleint2020-11-212-21/+20
| | | | | | | | | | | qtbase/612a01be6513894ab1ec5a36b699a2142ba7f35c deprecates QScopedPointer::take(), making it useless for the factory pattern. As a drive-by, fix the include order of abstractmetabuilder.cpp. Change-Id: I378f45d1c693fcd0423b4e2c96949d7e3be5d747 Reviewed-by: Christian Tismer <tismer@stackless.com>