aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystemparser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-281-3177/+0
| | | | | | | | 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 a disable-wrapper attribute for complex typesFriedemann Kleint2020-10-271-0/+4
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-081-10/+23
|\ | | | | | | Change-Id: I30aaad19852c50b1222222ba66171f9c98ecb7c8
| * shiboken2: Rearrange values of enum TypeEntry::CodeGenerationFriedemann Kleint2020-10-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TypeEntry::CodeGeneration::GenerateCpp was unused. Consequently, the GenerateAll mask is not needed, either. Replace GenerateCpp and GenerateTargetLang by a generic GenerateCode value. Introduce a new GenerationDisabled value to be able to distinguish a generate='no' XML attribute from a plain rejection. Fix many invalid usages of bool generateCode() testing against the flag value. Use the enum instead of uint for the code generation field. Task-number: PYSIDE-1202 Change-Id: I0aec5bd1ebfb9a50b80d5a187372c4271490e1b3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken2: Enable includes and modifications on typedef entriesFriedemann Kleint2020-10-081-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Extra includes might be required for the template instantiation type. Add the includes and modifications obtained from parsing the sub-elements to the target entry in endElement(). Complements bfd1de3495b18c0ecc251260442a9a46009861e. Task-number: PYSIDE-725 Task-number: PYSIDE-1202 Change-Id: I71e399879feb641238d4d6035faa3f4c34932a87 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Add QStringView/QByteArrayViewFriedemann Kleint2020-09-301-10/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | View types as function parameters cannot be converted in the standard way shiboken does it: QStringView cppArg0; pythonToCpp(pyArg, &cppArg0); since they reference some other data. Introduce a new "viewOn" member to type system entry for them. It causes the function arguments to be replaced by their viewed-on types (stringview->string) via metatype. Add a test in libsample and a test for QUuid::fromString(QStringView). Test returning QStringView via QRegularExpressionMatch::capturedView(). Task-number: QTBUG-84319 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Task-number: PYSIDE-487 Change-Id: Iddb4ea268a54928d290e29012e2738772fae83f0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-291-0/+5
|\| | | | | | | Change-Id: Ie6da3938b82f5ebe96dd12bd65a3ccc4180d2fba
| * shiboken2: Generate properties as fieldsFriedemann Kleint2020-09-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add an XML attribute specifying whether code is to be generated to the XML properties. - Split the generator functions for field setters and getters apart so that they can be used for generating property setters and getters. - Generate code for all properties from XML when the PySide extension is not used, otherwise only for those with the attribute set. Task-number: PYSIDE-1019 Change-Id: Iab2ba38b90038edc667a233c23c7113fdc6fb438 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-241-0/+35
|\| | | | | | | Change-Id: I7e4c7f9378706438715362b1e2da9a3cd2794562
| * shiboken2: Add a way of specifying properties in typesystem XMLFriedemann Kleint2020-09-231-0/+35
| | | | | | | | | | | | | | | | | | | | Add a list of TypeSystemProperty to ComplexTypeEntry, parse it from XML and add those properties in AbstractMetaBuilderPrivate::parseQ_Properties(). Task-number: PYSIDE-1019 Change-Id: Idf6ecde7c9de6bf1e56be423921672152e97de70 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-221-0/+23
|\| | | | | | | Change-Id: Id0fc76666bbdb254a833eeb6909a0874b2611bf3
| * shiboken2: Allow specifying the sequence of overloadsFriedemann Kleint2020-09-211-0/+23
| | | | | | | | | | | | | | | | | | | | | | Add an attribute to specify a number by which the functions will be sorted. This deactivates the default sorting which tries to avoid implicit conversions. Fixes: PYSIDE-1366 Change-Id: I9a891e21f86152b2fdfda9a48d685f19aa936508 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-211-11/+3
|\| | | | | | | Change-Id: Ia31df23a16575f9ecefe13ec85fb70197d103278
| * shiboken2: Remove workaround code for comparing QStringViewFriedemann Kleint2020-09-181-11/+0
| | | | | | | | | | | | | | | | The underlying issue has been fixed. Task-number: QTBUG-69389 Change-Id: I67416a9db7488db5f851ecb2f07884fbb410e4f0 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken2: Add attribute for generating "using namespace"Friedemann Kleint2020-09-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Make it possible to turn off the generation of using namespace. This is required in Qt 6 to avoid a clash between Qt3DCore::QBuffer and QBuffer used in __repr__. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Iaaf3e67f0ffaae86e2de82b9a1b8fe7d00c74e6b Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Remove QStringRefFriedemann Kleint2020-08-201-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port the remaining XML parser code in shiboken to QStringView. Remove the QStringRef type. The QStringView-related refactoring of QXmlStreamAttributes somehow exposed the value() methods of its base class (QList), which cause compilation errors. Remove them. Task-number: QTBUG-84319 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: If01516f962eddcc0591ccaff322843f2fc040549 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Start porting away from QStringRefFriedemann Kleint2020-08-191-42/+42
|/ | | | | | | | | | | | | QStringRef will be replaced by QStringView. Remove most usages or use auto. This will require a 2nd cleanup removing its usages from the QXmlStreamReader code once this has landed in qtbase. Task-number: QTBUG-84319 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I2885df70d5f883bcad7bb3a31618fc1d63116df5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Accept unqualified names for drop-type-entriesFriedemann Kleint2020-06-301-18/+20
| | | | | | | | | The option expected fully qualified type names (PySide2.QtNetwork.QSslKey), but the PySide2 CMakeLists only create unqualified names (QSslKey). Match this, too. Change-Id: I6c86a4ef9bb1a6bdb6a0672454ac2f2806477408 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Add file location to more warningsFriedemann Kleint2020-06-231-23/+31
| | | | | | | | | | | | | | | | | | | | Output most warnings in the standard file:line syntax used by compilers. This is done for C++ source code and typesystem files. Introduce a class SourceLocation and add it to type entry, AbstractMetaFunction and AbstractMetaClass. Move more messages into messages.cpp and output the location. Change the errors reported by the XML typesystem parser to the same format. [ChangeLog][shiboken] A number of error and warning messages have been prefixed by file name and line for better tooling. Task-number: PYSIDE-904 Change-Id: Ie2008f4060757e9d7ca1b25c00c7c5585240a7b8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Clean up code injection attributesFriedemann Kleint2020-06-191-20/+1
| | | | | | | | | | Remove the unused enumeration values. Change the class of the "declaration" position from "native" to "shell" since that is where it is used and mention it in the documentation. Task-number: PYSIDE-1282 Change-Id: I547b4bab055df27ce8b0b7b41b9d382dc8f175d1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken2: Improve whitespaces formatting in injected codeFriedemann Kleint2020-06-191-2/+2
| | | | | | | | | - Trim newlines and dedent all snippets from XML - Move the trailing newlines into the code snippet function. - Do not indent preprocessor directives Change-Id: Ic8c3745f0b88ee4ed27ac9cbaf376d71a50d9188 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Rename enum ContainerTypeEntry::Type to ContainerKindFriedemann Kleint2020-05-191-2/+2
| | | | | | | | As it is, it clashes with TypeEntry::Type. Task-number: PYSIDE-904 Change-Id: I51b269f188b39dc18412b83c3d659cbf61a99608 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-04-291-11/+0
|\ | | | | | | Change-Id: Ia9c2e8c7e4fb3665a78020ed154ab9a103368bd1
| * shiboken: Remove unused static functionsFriedemann Kleint2020-04-281-11/+0
| | | | | | | | | | | | | | | | Remove _compareAbstractMetaFunctions() msgInvalidVersion(), fixing warnings. Change-Id: I5f55b0de2d3c3fed2df09cb922c02569c937f7c1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Change most debug messages to use qCInfoFriedemann Kleint2020-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | A a check for the verbose level where missing, improve the formatting and use qCInfo. Adjust some levels. As an exception, leave the actual code model DOM dump within qCDebug. Task-number: PYSIDE-1265 Change-Id: I7d1d8015a35a543ae0b58ad9e3667ecdb741ce82 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-04-071-4/+0
|\| | | | | | | Change-Id: Id9d77dcbb396227a670e4455031ce074488c9e17
| * Revert "shiboken: Add XML attribute to turn off method caching"Friedemann Kleint2020-04-061-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fcbbab0a6b5949b5c3726214ed87898b5fbcebcc. This is no longer required after a fix generating the property code into the setattro methods of QObject-derived classes. Task-number: PYSIDE-803 Task-number: PYSIDE-1255 Change-Id: I9e989c0592eaaf25aa55a1db49537daa4bdb2a57 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-03-041-0/+4
|\| | | | | | | Change-Id: I7a94c67fdb9225edf4d605e67839a1f6f7375c2a
| * shiboken: Add XML attribute to turn off method cachingFriedemann Kleint2020-03-031-0/+4
| | | | | | | | | | | | Task-number: PYSIDE-803 Change-Id: I0ba80cea5804e1b83cc55ee32163ca9d021ccd26 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Remove InterfaceTypeEntryFriedemann Kleint2020-02-061-54/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InterfaceTypeEntry is a relic from Java, which does not have multiple inheritance. Remove it and handle it as object-type. Just removing the code breaks tests though, since AbstractMetaClass only has one pointer to its base class. The other base classes are added to the interface list. FAIL! shiboken2:testmultipleinheritance Newly detected Real test failure! FAIL! shiboken2:sample::ownership_invalidate_after_use Newly detected Real test failure! FAIL! shiboken2:sample::visibilitychange Newly detected Real test failure! [ChangeLog][shiboken] interface-type has been deprecated. object-type should be used instead. Change-Id: I19e876d82b26c2ef7865e3fafc74503c6cbd5a8b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Make it possible to specify smartpointer instantiationsFriedemann Kleint2020-02-051-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | Add an attribute "instantiations" to the smart-pointer-type element, which allows to specify a comma-separated list of instantiation types for which wrappers should be generated in the module. This avoids clashes of indexes. Task-number: PYSIDE-1024 Change-Id: Iac4b93b91ca4982064beef4c5abafc547052e7f1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Small code cleanupFriedemann Kleint2020-02-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix some left-over nullptr issues, C-style casts and some signedness issues. Remove some unused functions and parameters. Remove empty statements. Add defined() around macros, fixing warnings like: warning: '_WINDOWS' is not defined, evaluates to 0 Change-Id: Idaa4334cb0edb3661ca766c248ec18ab85b0ee8e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-02-041-22/+39
|\| | | | | | | Change-Id: I6e0693b8d7d1f7b506a759f15758bc4481a3baa0
| * shiboken: Introduce "until" version attribute as opposite of "since"Friedemann Kleint2020-01-241-22/+39
| | | | | | | | | | | | | | | | | | | | Prototypically use it for QMessageLogContext, allowing to elegantly build for Qt from version 5.12..now using a single type system file. Fixes: PYSIDE-1191 Change-Id: Iaa7bdc10c7129d84c54e85a09a1c802a409708f9 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Add a way of specifying system includes to be parsedFriedemann Kleint2019-12-051-1/+20
| | | | | | | | | | | | Task-number: PYSIDE-454 Change-Id: I9302cf74544315875a65bc09b75741c7fe6399e8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Fix classes in hidden namespacesFriedemann Kleint2019-12-031-1/+28
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an existing functionality to hide namespaces when specifying generate="no" on namespace-type which did not work for classes. In addition, it was implemented using the generation attributes of TypeEntry. This is problematic since dependent typesystems are loaded with generate="no", which actually means that no code should be generated for them. To fix this, introduce a new "visible" attribute for namespaces which also accommodates for hiding C++ 11 inline namespaces. Some projects uses the namespaces as packagename while creating python bindings, and to avoid duplicate names they ignore the original c++ namespace. For example a class like that: namespace Qt3D { class Vector; } The namespace "Qt3D" will be used as package name so the namespace "Qt3D" should be ignored during the generation, otherwise the 'Vector' type will be represented by 'Qt3D.Qt3D.Vector' and that is not what we want. Initial-patch-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com> Fixes: PYSIDE-1074 Change-Id: I3fd391ac3d839d3f8f510c6a4d4000f7d92eacff Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Refactor target lang nameFriedemann Kleint2019-11-251-8/+9
| | | | | | | | | | | | | | | | | | - Devirtualize TypeEntry::targetLangName() and replace by QString buildTargetLangName() that walks up the hierarchy and builds the name from the components. It populates a mutable variable m_cachedTargetLangName. - Implement setTargetLangName() to set m_cachedTargetLangName directly so that it works in all classes (for target-lang-name). - Implement a targetLangEntryName() that returns the last name part using the same pattern. - Remove the unused lookupName(). Fixes: PYSIDE-1133 Task-number: PYSIDE-990 Task-number: PYSIDE-1074 Change-Id: I15a6805a21584f1d7d4222e577e50907d7291841 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Store the unqualified entry name in TypeEntryFriedemann Kleint2019-11-251-28/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the previous change adding a parent pointer, this is working towards building the target lang name by walking up the hierarchy, prepending the names, making it possible to exclude namespaces. Pass the unqualified name from the XML parser and build the qualified name in the TypeEntry constructor. For this to work, a new ConstantValueTypeEntry is added replacing the abuse of EnumValueTypeEntry for nontype-template parameters. As a side effect, it is no longer possible to nest types by qualifying with "::" in XML: <object-type name="Class"/> <enum-type name="Class::Enum"/> This needs to be fixed in the type system files. [ChangeLog][shiboken] As a result of a code cleanup, it is no longer possible to nest types by by qualifying with "::" in the type system files. The elements need to be properly nested. Task-number: PYSIDE-990 Task-number: PYSIDE-1074 Change-Id: I8a2f93c40d59167b0ba205ef3ff3b325d242c3d3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Give the type system entries a pointer to their parentFriedemann Kleint2019-11-181-16/+58
| | | | | | | | | | | | | | | This helpful when building the qualified names including namepaces whose names may not appear (due to them being C++ inline namespaces or generation being disabled). With this, an accessor to the type system entry can be added, which helps to avoid ambiguities. Task-number: PYSIDE-990 Task-number: PYSIDE-1074 Change-Id: I7dce742770fbdbbc6ed0c3fce5120108dd12ffc4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
* shiboken: Replace QStringViewLiteral by u""Friedemann Kleint2019-08-121-126/+126
| | | | | | | | Adapt to the deprecation of QStringViewLiteral introduced by qtbase/c58ca4256d881ffed865602fd3da8efb6ebc9d5f. Change-Id: I688fc9b54a4bde83b6fb2a66704ec51bdde6b264 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Move typesystem parser out of typesystem.cppFriedemann Kleint2019-07-041-0/+2974
| | | | | | | | The file is too large to be maintainable. Task-number: PYSIDE-1024 Change-Id: I9e95ede1b7e7ce804059ef510dcec9dc9e773a48 Reviewed-by: Christian Tismer <tismer@stackless.com>
* remove pyside2 and shiboken2 submodules (dev edition)Oswald Buddenhagen2017-05-221-25/+0
| | | | to be replaced by a subtree merge.
* update: bring repositories back in syncChristian Tismer2017-02-151-15/+21
| | | | | | | From time to time, it is good to update the master project. Change-Id: I50c45caf7c37ebb4ea865b4e4f5896e5cd8915fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update the pyside-setup submodulesChristian Tismer2016-12-121-15/+15
| | | | | | | | | | From time to time, submodules need to be updated. Actually, I would even like to update the master module after every submodule checkin, but this seems to be not easy to do all the time. Change-Id: I52f266c58086186df05ddcc85085f35e2e28ead7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix OS/X inclusion of framework headers.Alexandru Croitor2016-06-161-6/+16
| | | | | | | | | | | | | | | | | | | | | The recent change that made use of framework headers on OS/X did not work with homebrew Qt, and it didn't work with official builds either, because neither of the chosen include folders contained all the necessary headers to lead to a successful build. Fortunately shiboken actually supports being passed multiple include locations, separated by a colon on OS/X, and a semicolon on Windows. This patch makes sure to always pass the Qt include folder, and in case if the Qt build is a framework build, also passes the root frameworks location, with headers found by shiboken under frameworkName.framewework/Headers. This works for homebrew builds, official builds and custom non-installed prefix / in-source builds of Qt. Change-Id: I47b24e197839883de2ab873461efc1f4d4d33743 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add option to link with libc++ on older OSX versions.Alexandru Croitor2016-05-111-5/+8
| | | | | | | | | | | | | | Versions of OSX lower than 10.9 link libstdc++ by default. Also libstdc++ is linked when the osx minimum deployment target is lower than 10.9. The new option allows explicitly linking libc++ in the cases mentioned above. It is not enabled by default, because most libraries and executables on versions lower than 10.9 are compiled with libstdc++, and mixing standard library versions can lead to crashes. Change-Id: I7397d2bbce2cfceaeb848f25e0bbf1a24ac9bde8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* a quick shiboken fix that should work, but will become obsolete with Qt 5.6.1Christian Tismer2016-04-191-11/+5
|
* fix the name pyside2uicChristian Tismer2016-04-191-5/+11
| | | | This was modified, but not corrected in setup.py
* UpdateThomas-Karl Pietrowski2016-04-021-5/+5
|
* shiboken should build with tests.Christian Tismer2016-02-231-8/+5
| | | | We will see how travis works now.