aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2/headergenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* shiboken2: Remove version suffix from generators directoryFriedemann Kleint2020-10-271-661/+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-14/+14
| | | | | | | | | | | | | | | | | | | | 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-29/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-141-3/+6
|\ | | | | | | Change-Id: I46f5d2dc758d0e1f23377c91ba7496793461771e
| * shiboken2: Use an AbstractMetaType for "void"Friedemann Kleint2020-10-131-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+7
|\| | | | | | | Change-Id: I30aaad19852c50b1222222ba66171f9c98ecb7c8
| * shiboken2: Generate extra includes into wrapper headerFriedemann Kleint2020-10-081-1/+7
| | | | | | | | | | | | | | | | | | | | For wrapper types, generate the class-related extra includes into the wrapper header since they might be required for it (for example, instantiation type of a typedef typesystem entry). Task-number: PYSIDE-1202 Change-Id: I9f57bdfe54d6273e4a1ffa9570e3352959dea480 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-011-16/+13
|\| | | | | | | Change-Id: Idaf124ad5e1d6a41d52918cecba47499be5e7324
| * shiboken2: Refactor global enum handling in HeaderGeneratorFriedemann Kleint2020-09-301-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate the sbk-index values for enums in writeTypeIndexValueLines(AbstractMetaClass *) for invisible namespaces as well instead of adding them to the global enum list. Remove checks for private/protected on global enums as they originate from namespaces. This removes one usage of ShibokenGenerator::lookForFunctionsInClassesNotToBeGenerated() which will be removed in a consecutive change. Task-number: PYSIDE-1075 Change-Id: I9ee7aba20802e9794f371006f9fdbd7ab8d67cab Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-301-4/+2
|\| | | | | | | Change-Id: I13721e13d2fab13945385fe529afe4ab431e0532
| * shiboken2: Change AbstractMetaClass::enums() to return const refFriedemann Kleint2020-09-291-4/+2
| | | | | | | | | | | | | | | | 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-171-0/+6
|\| | | | | | | Change-Id: I8aa48d07067c45c888c73af87314f6a88c2a6e14
| * Remove dependency of the QtQml module header on pysideqmlregistertype.hFriedemann Kleint2020-09-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to inject code into module headers by specifying "declaration" on type system code snippets. Use that to insert the struct definition into pyside2_qtqml_python.h and remove the include. Add the required includes via code injection into the wrapper and extra includes for the types. Fixes: PYSIDE-1381 Change-Id: I8dfda4c33d66f56e8fb516e1b174cc43664ca318 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>
* shiboken: Move wrapperName and type into GeneratorContextFriedemann Kleint2020-05-151-8/+8
| | | | | | | | | | | | | | | 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: Prepare for extending GeneratorContextFriedemann Kleint2020-05-151-1/+1
| | | | | | | | | Remove the constructor GeneratorContext and add creation functions to the generators. Make the class creation function virtual so that ShibokenGenerator can override it. Change-Id: I7bc002555356be73ddab5a2095802747796acb7e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Use GeneratorContext in more functionsFriedemann Kleint2020-05-151-1/+3
| | | | | Change-Id: Ief36279da5dfeeeacf83697d92b9f64680b2a56e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Constify GeneratorContextFriedemann Kleint2020-05-151-3/+4
| | | | | | | | | | | | Pass around by const-ref and return a const pointer to the class. In HeaderGenerator::generateClass(), make a copy of the context passed in to prevent writing back via reference in the base class loop. Change-Id: I0338bd93b5a53c25ec18bc45b407ab67d8c7c91e Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Refactor ShibokenGenerator::wrapperName()Friedemann Kleint2020-05-151-1/+2
| | | | | | | | | 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>
* shiboken: Remove some progress and other messagesFriedemann Kleint2020-04-181-2/+0
| | | | | | Task-number: PYSIDE-1265 Change-Id: I8c9651efcbe3d893ba191e0cf78cdcea39410b5c Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-03-041-1/+12
|\ | | | | | | Change-Id: I7a94c67fdb9225edf4d605e67839a1f6f7375c2a
| * Avoid the GIL in non-overridden MethodsChristian Tismer2020-03-031-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * shiboken: Fix usage of Qt's endl, preparing for Qt 6Friedemann Kleint2020-02-101-48/+48
| | | | | | | | | | | | | | | | | | | | | | 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: Handle smart pointers with const pointeesFriedemann Kleint2019-12-121-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Treat them equally to smart pointers with non-const pointees by searching for the pointee type entry in the instantiation search and stripping the const there. Create an additional type index equal to the non-const pointee index for the const pointee instantiation. This has the slight drawback that it is possible to invoke non-const calls on the pointee in Python, but this is nearly unfixable since the dispatch happens in the getattro method, where the information about constness is lost. Task-number: PYSIDE-454 Change-Id: Ib514816e408d727656b1599060e105ccd021bb07 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Fix usage of Qt's endl, preparing for Qt 6Friedemann Kleint2019-12-061-60/+60
| | | | | | | | | | | | | | | | 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-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Ignore deprecation warning about QSysInfo classChristian Tismer2019-09-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends 1bb4368a420ef12e3714bd4edfff34b8b3c983a8 . QSysInfo is deprecated and replaced by the QOperatingSystemVersion class which already exists. Before Qt 6.0 is out, we can not remove these classes. Fortunately, the warning can be suppressed by setting QT_WARNING_DISABLE_DEPRECATED. The options was already in the generated code, but the placement was too late. The qsysinfo include happens in the line // module include #include "pyside2_qtcore_python.h" which comes right after the first "usePySideExtensions" section. Furthermore, the used template in headergenerator.cpp needed the setting when the deprecated enum ocurred. The section after "// Macros for type check" got the setting, too, so that all calls to HeaderGenerator::writeSbkTypeFunction were excluded from warnings. Change-Id: Ife96f5ade26437b23cb756ee1b94af23d4a81faa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Introduce autoFriedemann Kleint2019-06-251-1/+1
| | | | | | | Apply Fixits by Qt Creator with some amendments. Change-Id: Ib2be1012ef7e8a2ad0e6cd130371bf1e941c4264 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Cleanup pointer whitespace everywhereChristian Tismer2019-06-241-36/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Among other files to fix, basewrapper.(cpp|h) was full of uncommon pointer whitespace. After fixing that, I could not resist and fixed also libshiboken, generators, and after acceptance also PySide. Most of the time, this regex worked fine (\w\w+)([*&]+)[ ]*(?![&*]*[/=]) replaced with \1 \2 but everything was checked by hand. I did not touch the shiboken tests which are quite hairy. It turned out that inserting a space between a variable and asterisk causes a crash of shiboken, if the same line contains "CONVERTTOCPP". This was temporarily fixed by adding another space after it. Example.. sources/pyside2/PySide2/glue/qtcore.cpp line 977 QByteArray * cppSelf = %CONVERTTOCPP[QByteArray *](obj); //XXX /|\ omitting this space crashes shiboken! cppgenerator.cpp was special, since it was modified to _generate_ correct pointer whitespace. This caused a few testcases to fail, which had to be adjusted, again. This was difficult since some internal names must end on "*" and generated code normally not. Removing the last errors involved binary search on path sets... Apply C++ 11 fixits to the changed code, where applicable. Done-with: Friedemann.Kleint@qt.io Task-number: PYSIDE-1037 Change-Id: I4ac070f52c5efb296c05d581c9d46e6f397a6c81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Fix handling shared pointers passed by const-ref, take 2Friedemann Kleint2019-06-131-4/+2
| | | | | | | | | | | | | | | | With fd126b28e1d9b02ea16c813bc392461bdb05bd1d, broken wrapper code would still be generated for "const_QSharedPointer_QSize___&" depending on whether the const-ref or plain value type was encountered first when parsing. Fix the problem by stripping the qualifiers from the metatype added to GeneratorPrivate::m_instantiatedSmartPointers partially reverting fd126b28e1d9b02ea16c813bc392461bdb05bd1d. Change-Id: Ie6691e045b7d65baa3a0bc72dd8637f09eeaf111 Fixes: PYSIDE-1016 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Fix generation of init functions and types for const-refs of smart ↵Friedemann Kleint2019-06-061-2/+5
| | | | | | | | | | | | | | pointers Add a convenience to strip all qualifiers and use that. This at least fixes the naming (for example, getInitFunctionName returning "const_QSharedPointer_QSize___&"), the init function for the type itself is missing, though. Task-number: PYSIDE-1016 Change-Id: Id61b3c879199fc061e2846007951e3e9c82b85c4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Sort writing of type indices when generating module header fileAlexandru Croitor2018-10-231-1/+8
| | | | | | | | | | | | | | | | Due to some unknown determinism, sometimes the type indices written to the generated module header file have a slightly different order, which means that many cpp files need to be rebuilt for no reason (semantically the content of the header file does not change). Make sure to sort the class list by type indices, to try and make the generated header file as deterministic as possible. This is a pre-requisite for improved incremental builds. Change-Id: Ie6a334453cdbfbb601fbac4b6be9291a746650f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Add a typedef typesystem entryFriedemann Kleint2018-09-051-0/+30
| | | | | | | | | | | | | The intention is be able to specify typedef std::optional<int> OptionalInt in the typesystem file and generate code for it (without having a typedef in C++). Task-number: PYSIDE-725 Change-Id: I5847a3c3f68556ac1d0ea3635f65a29caa6cb208 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Reduce generated include statementsFriedemann Kleint2018-08-221-8/+0
| | | | | | | | Remove shiboken.h from the wrappers and some unneeded headers from the module header. Change-Id: Ib05433e77686e544e3dcae27f5256ae1bbf146e1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Expose Shiboken generated Python module objectTilman Roeder2018-08-221-0/+2
| | | | | | | | | | | | | This change exposes the module object (a PyObject*) to the global namespace as Sbk[TYPESYSTEM NAME]ModuleObject. This is useful when generating bindings for cases where Python will run embedded into a host application. This variable is also included in the headers, where it is declared as `extern PyObject* Sbk[TYPESYSTEM NAME]ModuleObject;` for the convenience of developers reading the generated sources. Change-Id: Iaaa38b66b5d3aabc0fb8f995f964cd7aef2a11da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Generate anonymous int-type enums instead of index macrosFriedemann Kleint2018-07-301-39/+38
| | | | | | | | | | | | | | | | | | | | | | #define SBK_QMETAOBJECT_CONNECTION_IDX 158 #define SBK_QTEXTCODEC_CONVERTERSTATE_IDX 246 becomes: enum : int { SBK_QMETAOBJECT_CONNECTION_IDX = 158, SBK_QTEXTCODEC_CONVERTERSTATE_IDX = 246, which is more pleasing to the eye. Rename the helper _writeTypeIndexDefineLine() to _writeTypeIndexValue() for the enum values and split out a function that writes the value only so that some code duplication can be avoided. Change-Id: I0d51afbbe93e515ba1dce1275fa5a01a6bcd95ca Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix some clang-tidy warnings in shibokenFriedemann Kleint2018-07-231-9/+8
| | | | | | | | | | | | | | | | | - 'else if' after return/break/continue - Use const ref for complex arguments passed by value where possible - Fix 'if (foo) delete foo' to 'delete foo' - Use container.isEmpty() instead of container.size() in checks - Use ' = default' for trivial constructors/destructors - Use range based for where possible - Complete constructor initializer lists - Fix invocations of static methods - Replace some reinterpret_cast by static_cast - Remove unused variables/fields - Use initializer lists for return types Change-Id: Id5b44a2f9d429f66ef069d532a1cd31df796d38e Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Make revision and SBK index a member of TypeEntryFriedemann Kleint2018-07-131-1/+1
| | | | | | | | | | | | | | | | | | They were previously stored in a global hash, apparently due to BC issues. Replace the global set/getTypeIndex/Revision functions by member functions of TypeEntry in typedatabase.cpp. As a drive-by change, simplify the code assigning the SBK numbers to use a flat list of entries ordered by revision and name instead of a grouped hash (bearing in mind that revision is rarely used) and might be removed one day). Also replace the use of std::unique() by the !contains()/append() pattern since std::unique() assumes an ordered list which is likely not the case. Task-number: PYSIDE-725 Task-number: PYSIDE-743 Change-Id: I9356acf1f5795446c08f266c1323f1db65cd490c Reviewed-by: Christian Tismer <tismer@stackless.com>
* Change license from all the filesCristian Maureira-Fredes2018-05-031-1/+1
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename PySide references to Qt for PythonCristian Maureira-Fredes2018-04-271-1/+1
| | | | | | | | | When referring to the project one should use "Qt for Python" and for the module "PySide2" Change-Id: I36497df245c9f6dd60d6e160e2fc805e48cefcae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Rename Generator::fileNamePrefix() to fileNameSuffix()Friedemann Kleint2018-03-211-3/+3
| | | | | | Change-Id: If7464f643fca74aa06099ca4b9905b34bd077193 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Shiboken: Handle private abstract methodsFriedemann Kleint2018-01-191-2/+3
| | | | | | | | | Remove the exclusion. Required for Qt3dExtras::QAbstractCameraController::moveCamera() in 5.10. Task-number: PYSIDE-487 Change-Id: I67ae24d4cda2d90ac30c97f77457c2eaf65099ab Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Fix some clazy warningsFriedemann Kleint2018-01-171-1/+1
| | | | | | | | | | | | - Mixing const/non-const iterators - Do not use operator[] on temporaries of type QVector - Remove unused nontrivial variables - Add Q_FALLTHROUGH() - Potential detach in range-based for Change-Id: I89391fdda616f119eadd7de529eb6cee69343f85 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Generate override instead of virtualFriedemann Kleint2017-12-051-11/+8
| | | | | Change-Id: Ifcbabe09665c33daf5dd8d5df52036598c9f428f Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Do not generate wrapper methods for final C++ methodsFriedemann Kleint2017-12-021-1/+2
| | | | | | | | | This will result in a compilation error (overriding final method). Final methods appear in Qt3DInput::QMouse/QKeyboardDevice. Task-number: PYSIDE-487 Change-Id: I6eb300c91327c587b6bfe530fdafb519817171c4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-061-1/+1
|\ | | | | | | Change-Id: I72583df407fc5b3caa8bf35fd997889a4ac86512
| * Remove dead / unused code regarding conversionsAlexandru Croitor2017-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a lot of code that was previously used for doing conversions between C++ / Python types (apparently relying on extensive RTTI / typeid manipulations), which got superseded by a cleaner templated approach. The old code was left behind, and there were a few instances where it was still used even though it wasn't needed, like in QtScript typesystem XML and shiboken's enum handling. Remove the old code, apply the small changes needed to make it work with new the code. This is cleanup to reduce the confusion regarding conversion behavior, and also preparation for a proper implementation of handling "void*" types. Change-Id: I8f16bb31436f9a677bb2d64c7197c4375005b656 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-06-091-7/+32
|\| | | | | | | Change-Id: I73f39966a2af7aa935e1890e29c9b71573aae97c
| * Fix missing headers in PySide custom buildChristian Tismer2017-06-091-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PySide itself built fine after the additional includes were added for inheritance. But when a smaller project is built, suddenly header files are not found, because the inherited names are not expected by the deployment. Therefore, we do no longer add more includes, but insert recursive headers for the few relevant cases. So the includes become a little longer, but the names of the include files are those as before the enhanced inheritance. Task-number: PYSIDE-500 Change-Id: Iab456307a3c2365dfe1964dbe222b7d0efac7878 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * move everying into sources/shiboken2Oswald Buddenhagen2017-05-221-0/+558
| | | | | | in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.