aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* shiboken2: Remove version suffix from generators directoryFriedemann Kleint2020-10-271-2881/+0
| | | | | | | | 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-271-63/+65
| | | | | | | | | | | | | | | | | | | | 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>
* shiboken2: AbstractMetaType: use QSharedData[Pointer]Friedemann Kleint2020-10-231-134/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-221-1/+1
|\ | | | | | | Change-Id: I68ec1e4b80fcc8c395eacb7d5046fdd8e00535e0
| * Update SmartPointers conversionsRenato Araujo Oliveira Filho2020-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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-141-7/+4
|\| | | | | | | Change-Id: I46f5d2dc758d0e1f23377c91ba7496793461771e
| * shiboken2: Some RefactoringsFriedemann Kleint2020-10-141-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | - AbstractMetaType: Pass TypeEntry to constructor - AbstractMetaType: Return instantiations() by const ref - AbstractMetaClass: Make baseTemplateInstantiations a member instead of a global hash. Simplify the code accordingly. Task-number: PYSIDE-1202 Change-Id: I1a18aa4ff97481af8cb13e8732fe3952c48edb29 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken2: Use an AbstractMetaType for "void"Friedemann Kleint2020-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, nullptr for an AbstractMetaType meant "void", particularly for function return types. The problem with this is that it causes unexpected crashes when dealing with template types like QFuture<void> due to one of the instantiations of the AbstractMetaType being nullptr. Use an AbstractMetaType based on the existing "void" type entry for this. Task-number: PYSIDE-1202 Change-Id: Ib06035cc7903480fd509f7e927d9114c55d51b62 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-081-3/+2
|\| | | | | | | Change-Id: I30aaad19852c50b1222222ba66171f9c98ecb7c8
| * shiboken2: Rearrange values of enum TypeEntry::CodeGenerationFriedemann Kleint2020-10-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-011-19/+13
|\| | | | | | | Change-Id: Idaf124ad5e1d6a41d52918cecba47499be5e7324
| * shiboken2: Generate functions from invisible namespaces into their parent ↵Friedemann Kleint2020-09-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | namespaces Add them in ShibokenGenerator::getFunctionGroupsImpl() with some helpers. Fixes: PYSIDE-1075 Change-Id: Ie627c6e12f82e40cdb4f306ddac6b682e77124c5 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken2: Generate functions from invisible top level namespaces as global ↵Friedemann Kleint2020-09-301-4/+11
| | | | | | | | | | | | | | | | | | | | | | functions Mainly add those in ShibokenGenerator::getGlobalFunctionGroups() with some adaptions. Task-number: PYSIDE-1075 Change-Id: I6dabac72c204904e76162542b5aa3ea1ac3b56ec Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken2: Refactor handling of invisible top level namespacesFriedemann Kleint2020-09-301-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid having to add a ShibokenGenerator::lookForFunctionsInClassesNotToBeGenerated() to fix the function issue, replace ShibokenGenerator::lookForEnumsInClassesNotToBeGenerated() by several helper functions: - Add a list of top level invisible namespace to the generators - Add functions to retrieve enumerations of nested invisible namespaces to AbstractMetaClass with recursion helpers. Task-number: PYSIDE-1075 Change-Id: I421113770e622611caeb221498b872d0a6ba1aeb Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-301-2/+1
|\| | | | | | | Change-Id: I13721e13d2fab13945385fe529afe4ab431e0532
| * shiboken2: Change AbstractMetaClass::enums() to return const refFriedemann Kleint2020-09-291-2/+1
| | | | | | | | | | | | | | | | This allows for removing a few temporary variables and/or qAsConst(). Task-number: PYSIDE-1075 Change-Id: Ib48070950ac682ec66e19af3dc8c0be5bfdffcee Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-291-6/+29
|\| | | | | | | Change-Id: Ie6da3938b82f5ebe96dd12bd65a3ccc4180d2fba
| * shiboken2: MetaBuilder/ApiExtractor/Generator: Return class/enum/function ↵Friedemann Kleint2020-09-281-4/+2
| | | | | | | | | | | | | | | | | | | | lists by const ref This allows for removing a few temporary variables and/or qAsConst(). Task-number: PYSIDE-1075 Change-Id: I0fe3544f0ce4d3a8d56de9c93e300972e0844177 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken2: Generate properties as fieldsFriedemann Kleint2020-09-281-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-161-13/+14
|\| | | | | | | Change-Id: I114a003e36bbe9eb7452f13c1515e3419648e228
| * shiboken2: Refactor primitive type lists in overload decisorFriedemann Kleint2020-09-111-13/+14
| | | | | | | | | | | | | | | | | | | | Add a separate header with the type names and use that. Add the missing long long on this occasion. Task-number: PYSIDE-1372 Change-Id: Id3c35c6b2c4e7eebfe1d25b555ab62468cb89f1d Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Start porting away from QStringRefFriedemann Kleint2020-08-191-1/+1
|/ | | | | | | | | | | | | 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: Handle default parameters of const pointersFriedemann Kleint2020-07-141-0/+6
| | | | | | | | | | | | Occurs in Qt 6: QKeyEvent(..., const QInputDevice *device = QInputDevice::primaryKeyboard()); We need a const-cast here since shiboken needs a QInputDevice * for type conversion. Change-Id: Iea1137eac44a26b7bc9cf0e1908c0e42ba2de39f Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken2: Improve whitespaces formatting in injected codeFriedemann Kleint2020-06-191-3/+3
| | | | | | | | | - 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>
* Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-06-111-1/+1
|\ | | | | | | Change-Id: I6cf604e1ae7234ce4f0d99169e9269a7dde07a4a
| * shiboken: Fix default-initialized function argumentsFriedemann Kleint2020-06-111-1/+1
| | | | | | | | | | | | | | | | Specifying {} causes it to be qualified, check this. Change-Id: Idd23c8a5af01cd7fbb63a2e5a01bb349c530fe54 Fixes: PYSIDE-1325 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Rename enum ContainerTypeEntry::Type to ContainerKindFriedemann Kleint2020-05-191-5/+6
| | | | | | | | | | | | | | | | As it is, it clashes with TypeEntry::Type. Task-number: PYSIDE-904 Change-Id: I51b269f188b39dc18412b83c3d659cbf61a99608 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Move wrapperName and type into GeneratorContextFriedemann Kleint2020-05-151-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a Type enumeration to GeneratorContext and add the wrapper name as a string. Overwrite creation function in ShibokenGenerator to add this. Remove unused wrapperName overloads. Use the wrapper name and type from the GeneratorContext where applicable instead of repeatedly running the check in shouldGenerateCppWrapper(). Change-Id: I52cace3ad165c2cd6c6ce718cec822abfb8ad8ce Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Use GeneratorContext in more functionsFriedemann Kleint2020-05-151-15/+35
| | | | | | | | | | Change-Id: Ief36279da5dfeeeacf83697d92b9f64680b2a56e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Refactor ShibokenGenerator::wrapperName()Friedemann Kleint2020-05-151-11/+12
| | | | | | | | | | | | | | | | | | Assert that it is only used for wrapped classes and remove fallback path returning the class name, which obfuscates the code. Change-Id: I9af1a6a9edc5e566296ec99a50a9f8cfbe055cd0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Revert "Revert "Fix deprecation warnings about Qt::SplitBehavior""Friedemann Kleint2020-05-151-1/+1
| | | | | | | | | | | | | | | | | | Fix warnings in 5.15. This reverts commit 2ca788f85fbc9d58969533d13046bbe19f53fac8. Change-Id: Iaee39e2035f5e4ebdc9b5360a68a5f024f8bde38 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-05-131-1/+1
|\| | | | | | | Change-Id: I9fbc4217d1cdc0cb2c57459b56aa283dd9c6ef45
| * Revert "Fix deprecation warnings about Qt::SplitBehavior"Friedemann Kleint2020-05-131-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 0b7a1be238c585cea66732c4ed3287f325395865. 5.14 is supposed to compile against 5.12, still. Change-Id: I4170a6f5c1506b123d3a4947b4070be2bf4dd5cd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Enable injecting raw code for setattro/getattroFriedemann Kleint2020-05-041-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | Setattro/getattro functions can be added. As shiboken also uses these functions internally, the code blocks are inserted into those implementations. As those are special functions, only raw code is injected. No macros are replaced for arguments or instances. Fixes: PYSIDE-1280 Change-Id: I207dcf70b3a9f5edc51ff6566b31a2a8aa4776ed Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add an option for diagnostic output for wrappersFriedemann Kleint2020-04-301-1/+6
| | | | | | | | | | | | | | | | | | | | Print which wrappers are instantiated and what the methd cache entry contains for the virtual methods. Task-number: PYSIDE-1255 Change-Id: Ib5fd92a78a4ff1b53e373b82ade8f67b95c0dd26 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-04-071-3/+8
|\| | | | | | | Change-Id: Id9d77dcbb396227a670e4455031ce074488c9e17
| * Revert "shiboken: Add XML attribute to turn off method caching"Friedemann Kleint2020-04-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * shiboken: Fix Qt properties not working in classes inheriting QObjectFriedemann Kleint2020-04-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The fixes for PYSIDE-803 caused setattro methods to be generated for many classes, resulting in QObject's setattro method no longer being called. Generate property code in each class inheriting QObject. Task-number: PYSIDE-803 Fixes: PYSIDE-1255 Change-Id: I56f52fb43c4ddc77914090ac122776050354ddbe Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-03-041-1/+28
|\| | | | | | | Change-Id: I7a94c67fdb9225edf4d605e67839a1f6f7375c2a
| * Fix deprecation warnings about Qt::SplitBehaviorFriedemann Kleint2020-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | sources/shiboken2/generator/shiboken2/cppgenerator.cpp:1480:95: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:1483:96: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:1931:95: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:5774:110: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/main.cpp:373:67: warning: 'QStringList QString::split(QChar, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:99:88: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] Change-Id: Iadddcc74679a71ebf803b6a2942d9a50dbeeb05e Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Avoid the GIL in non-overridden MethodsChristian Tismer2020-03-031-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to get better performance, we try to avoid allocating the GIL when methods have no override with a Python function. Every class gets an associated bool array that records functions where no override was found. On second call of a function, the GIL is avoided by this flag. Update 2020-02-06: The result is very promising when combined with a drastic reduction of Py_(BEGIN|END)_ALLOW_THREAD macro calls. So this could become the solution when combined with a good reduction! The Python 2 bug was circumvented by not generating the additional Py_tp_setattro functions for class QQuickItem. Task-number: PYSIDE-803 Change-Id: I0fe36edc5610b2d51bbb05f1b7507beee5088c83 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-02-121-17/+20
|\| | | | | | | Change-Id: I2adfe791173a63b90a2e2c71fb1751052550f76b
| * shiboken: Refactor writing of get/setattro methodsFriedemann Kleint2020-02-101-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getattro functions are needed for: - smartpointer dispatch - special cases of function overload resolution setattro functions are needed for: - smartpointer dispatch - QObject property handling All of this was previously handled in the writeSet/GetattroFunction which duplicated, inconsistent checks in various places, which makes it very hard to add additional functionality to tp_getsetattro(). To overcome this, define a flag to describe the various use cases, a check function to determine it. The flag is passed to the write functions. Smart pointer handling is split out completely since it will never mix with the other use cases. Task-number: PYSIDE-803 Change-Id: Iead9ee5b086830fb670b25917914117da62fefe5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Fix usage of Qt's endl, preparing for Qt 6Friedemann Kleint2020-02-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | Cherry-pick the part of 870b7f4c849ebbc5f39f1f2398e39a3b7dfd9562 from 5.15 that joins "bla" << endl into "bla\n" to reduce further merge conflicts between 5.14 and 5.15 while preserving the ability of 5.14 to compile against Qt 5.12. Change-Id: Id9632973b253557c99b2f4e0a84c3db12c55f5b4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 870b7f4c849ebbc5f39f1f2398e39a3b7dfd9562)
* | shiboken: Small code cleanupFriedemann Kleint2020-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | shiboken/typedatabase: Match multiple type entries by nameFriedemann Kleint2020-01-061-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For smart pointer instantiations, type entries from multiple modules need to be searched, which is currently not implemented. Extend the type database to return all type entries by name. Split out the code finding a type entry from AbstractMetaBuilderPrivate::translateType() and change it return a list. Ignore duplicate primitive types for now since that cannot be easily avoided. Task-number: PYSIDE-1024 Change-Id: I4a30b9151b472acff5fba221019a2e321807d4a0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Fix usage of Qt's endl, preparing for Qt 6Friedemann Kleint2019-12-061-7/+7
| | | | | | | | | | | | | | | | endl and other manipulators will move into the Qt namespace in Qt 6. Replace it by '\n' or add the namespace. Change-Id: Id9632973b253557c99b2f4e0a84c3db12c55f5b4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Fix classes in hidden namespacesFriedemann Kleint2019-12-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Clean up handling of enclosing classFriedemann Kleint2019-12-031-16/+0
|/ | | | | | | | | | | Add a EnclosingClassMixin which provides targetLangEnclosingClass() by walking up the hierarchy and remove duplicated code. Task-number: PYSIDE-990 Task-number: PYSIDE-1074 Change-Id: Ia69b687a34e735f74265d72727e6bad3216c33f0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Refactor lookForEnumsInClassesNotToBeGenerated()Friedemann Kleint2019-11-011-9/+7
| | | | | | | | | | Remove the recursion to the parent class which does not seem to have any effect. Add a comment and simplify. Task-number: PYSIDE-990 Task-number: PYSIDE-1074 Change-Id: I92ddb08e051853636d154541d805a54bdc7d3a87 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>