aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
Commit message (Collapse)AuthorAgeFilesLines
* shiboken: Fix classes in hidden namespacesFriedemann Kleint2019-12-0319-25/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-035-62/+32
| | | | | | | | | | | 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>
* libsample: Test renaming via "target-lang-name" attributeFriedemann Kleint2019-12-037-0/+160
| | | | | | | | | | | | | | | | | | | | | | | Rename a class and test repr and signatures of users. The test fails F ====================================================================== FAIL test (__main__.RenamingTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "renaming_test.py", line 46, in test "(self, v 'sample.RenamedValue')") AssertionError "(self, v: 'sample.ToBeRenamedValue')" != "(self, v: 'sample.RenamedValue')" - (self, v 'sample.ToBeRenamedValue') ? ---- + (self, v 'sample.RenamedValue') Task-number: PYSIDE-1133 Task-number: PYSIDE-990 Task-number: PYSIDE-1074 Change-Id: I402439fd202c33cac281c4628ceba79406198a27 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Refactor Debug operator of AbstractMetaClassFriedemann Kleint2019-12-032-51/+59
| | | | | | | | | Output members only when verbose is set and make template parameters/instantiations more prominent. Task-number: PYSIDE-454 Change-Id: I0fca089c55c84c761385d280962599859a61ae7d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Avoid initializing QFlags with 0 or nullptrFriedemann Kleint2019-12-032-3/+3
| | | | | | | | | | | | Preemptively fix warnings: sources/shiboken2/ApiExtractor/abstractmetalang.cpp:531:28: warning: 'constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = AbstractMetaFunction::CompareResultFlag; QFlags<T>::Zero = int QFlags<AbstractMetaFunction::CompareResultFlag>::Private::*]' is deprecated: Use default constructor instead [-Wdeprecated-declarations] sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp:1234:47: warning: 'constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = AbstractMetaAttributes::Attribute; QFlags<T>::Zero = int QFlags<AbstractMetaAttributes::Attribute>::Private::*]' is deprecated: Use default constructor instead [-Wdeprecated-declarations] sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp:1332:30: warning: 'constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = AbstractMetaAttributes::Attribute; QFlags<T>::Zero = int QFlags<AbstractMetaAttributes::Attribute>::Private::*]' is deprecated: Use default constructor instead [-Wdeprecated-declarations] introduced by qtbase/af2daafde72db02454d24b7d691aa6861525ab99 in 5.15 Change-Id: Ib66697d8fd5c400619f6193e21572dcccdb4534c Reviewed-by: Christian Tismer <tismer@stackless.com>
* Bump version numbersSimo Fält2019-12-031-1/+1
| | | | | Change-Id: Ifa5d9076653e377dbd7f5e4ca3f49e427fa0ee65 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Refactor metatype comparisonFriedemann Kleint2019-11-253-42/+50
| | | | | | | | | | Remove unused code left over from previous changes and add flags for matching value and const-ref as equivalent. Rename a few functions for improved clarity. Change-Id: Ifac1414e4977643b18d31dfc63a8e4a5f89a2ddc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Shiboken: QtDoc: Fix the new filename logic for the extras foundVenugopal Shivashankar2019-11-251-1/+1
| | | | | | | | | Otherwise, the extras are never copied to the respective module directories, resulting in no HTMLs for them. Change-Id: Ibb509178bde9cf2477c3791ee56da1affbe4d74e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* shiboken: Refactor target lang nameFriedemann Kleint2019-11-257-157/+76
| | | | | | | | | | | | | | | | | | - 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-258-130/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace imp by importlibCristián Maureira-Fredes2019-11-191-6/+11
| | | | | | | | Getting rid of the DeprecationWarning Change-Id: I86370c266d502fcd0fb61a9945770354b8f87142 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Give the type system entries a pointer to their parentFriedemann Kleint2019-11-187-78/+189
| | | | | | | | | | | | | | | 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: Fix crash when smartptr template class cannot be foundFriedemann Kleint2019-11-183-1/+23
| | | | | | | | | | shiboken currently crashes when naively trying to use std::shared_ptr since it does not see the template due to system directories being excluded from clang parsing. Add an error message and bail out. Task-number: PYSIDE-454 Change-Id: I6627e968061f8f704a90f898879f3861308e1705 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Doc: Drop PySide prefix from the RST filenamesVenugopal Shivashankar2019-11-181-2/+10
| | | | | | | | | | | | | | | Shiboken appends the content in these RSTs to the module index pages that it generates. In addition, - updated the snippets, extras, and additional docs passed to the Shiboken call. - moved the copy_directory command right before the shiboken call. Change-Id: I45222ba7d0798105a764d7692d466f7a2a105d77 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken/Doc generator: Refactor the Table classFriedemann Kleint2019-11-152-42/+55
| | | | | | | Use QVector and no longer inherit the container. Change-Id: I7ab9df4cefa408c01324d88737d639b80b45fc48 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Remove more usages of QListFriedemann Kleint2019-11-153-6/+7
| | | | | | | The class will be deprecated in Qt 6. Change-Id: Iafafca43615fc8035ac532afb9dcb18f7ab6ce92 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Refactor the logic deciding whether headers should be parsedFriedemann Kleint2019-11-151-31/+48
| | | | | | | | | | | - Use cstring and prefix by std - Split the functions into base name and comparison functions - Use a non-type template to pass the size for startsWith() - Split out visitHeader() for clarity Task-number: PYSIDE-454 Change-Id: I48e2a9ae5fead892c20d9729cb90d61ff5d7fb0a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Refactor TypeEntry::addExtraInclude()Friedemann Kleint2019-11-152-13/+12
| | | | | | | | | | Remove the QHash<QString, bool> m_includesUsed and do a linear search for existing includes instead since the number is small and repack the members. Task-number: PYSIDE-454 Change-Id: I30cb08d271b56778a6964476f66602569e5c6ce5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Split the headers of libsmartFriedemann Kleint2019-11-146-193/+370
| | | | | | | | | | | | Prepare for adding further tests. On this occasion, polish the code a bit, move the logging of the shared pointer into a base class to get rid of the iostream include in the header. Task-number: PYSIDE-454 Change-Id: Ifd05a7d3ceeae1c85e7193991907bf6d1e8e98ee Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix clang parsing with update MSCV versionsFriedemann Kleint2019-11-131-0/+2
| | | | | | | | | Turn off clang check: STL1000: Unexpected compiler version, expected Clang 7 or newer Change-Id: I30e962174dfe468d570fae56c0e1b883c622a6a0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Remove unused codeFriedemann Kleint2019-11-075-40/+0
| | | | | Change-Id: Idf421747a41fbc7c58e8cc84023426bc12b47544 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Simplify recreation of registry filesChristian Tismer2019-11-071-0/+11
| | | | | | | | | | | | | | | The registry files were recreated when they do not exist. This was used to trigger recreation on a file. We now include a comment line on top of the files. #recreate # uncomment this to enforce generation By uncommenting this line, a NameError is provoked, which has the desired effect without creating huge deltas in the repository. Change-Id: Idcc1015abae504f111102e8c9851f8ef45dcbdff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
* Merge remote-tracking branch 'origin/5.13' into 5.14Friedemann Kleint2019-10-319-19/+73
|\ | | | | | | Change-Id: I9f31a647fd9d4ad9c854a307f8b5df1be935354a
| * Fix Python 3 deprecation warning about Buffer APIFriedemann Kleint2019-10-251-0/+4
| | | | | | | | | | | | | | | | | | Use new buffer protocol, fixing: sources/shiboken2/libshiboken/shibokenbuffer.cpp: In function ‘bool Shiboken::Buffer::checkType(PyObject*)’: sources/shiboken2/libshiboken/shibokenbuffer.cpp:46:42: warning: ‘int PyObject_CheckReadBuffer(PyObject*)’ is deprecated [-Wdeprecated-declarations] Change-Id: I3e3a403306d86c940bf1bd71fc672db6e0a2ea60 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * abstractmetabuilder_p.h: Fix compilation with some versions of g++Friedemann Kleint2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | Fix the return type, which caused complaints by some versions of g++: sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h: In member function 'ScopeModelItem AbstractMetaBuilderPrivate::popScope()': sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h:61:57: error: could not convert 'QList<T>::takeLast() [with T = QSharedPointer<_NamespaceModelItem>]()' from 'QSharedPointer<_NamespaceModelItem>' to 'QSharedPointer<_ScopeModelItem>' Change-Id: I94abdfb9d76d3f0078e198b4230129150d2f43ea Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Shiboken: QtDoc: Fix how brief and class tags are handledVenugopal Shivashankar2019-10-251-5/+1
| | | | | | | | | | | | | | | | | | | | | | - The brief attribute of a page tag should be ignored to avoid briefs appearing twice. - The class ref pages should use the .. currentmodule:: rst directive instead of the .. module::. Change-Id: Iac205d60f79db49eb8c69a2593f09fb206a5b1a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken: Fix pyi generation for external modulesAndreas Beckermann2019-10-251-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enum_sig.py is used to generate .pyi files (in sources/pyside2/PySide2/support/generate_pyi.py) from the bindings. The file can also be useful by external modules that were generated by shiboken, however the check for the modulename being PySide2 or shiboken2 prevents this. Remove this check, as discussed on IRC. This seems to be working internally as well and re-adds support for usages by external modules. Change-Id: I81af943c43f8f84aa0b0d89260cd99215acdb10d Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix hasVirtualDestructor() for implicit destructorsAndreas Beckermann2019-10-253-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a derived class does not declare an explicit destructor, AbstractMetaClass::hasVirtualDestructor() is set to false. However this is incorrect for classes that have a base class that in turn provide a virtual destructor. Consequently shiboken generates incorrect code in cases where it depends on that value (e.g. for methods that override ownership of the returned object - instead of releasing ownership, shiboken invalidates it). This patch considers the baseClass()->hasVirtualDestructor() after traversing all functions (which checks for explicit destructors). Change-Id: Ifc4a472290d835dd6ef7d702b912643c9a2b42da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Add support for __repr__ in QObject derived classesAndreas Beckermann2019-10-255-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently shiboken generates classes without __repr__ for QObject derived classes. However for all non-QObject classes that have an operator<<() for QDebug, it *does* add a valid repr implementation. Extend this behavior to QObject classes as well. In order for this to become more useful, also check for the indirection of operator<<(): If operator<<(QDebug, Foo*) is available, use the current non-value-type behavior, (i.e. provide cppSelf to operator<<()), but if operator<<(QDebug, const Foo&) is available instead, use the same behavior as for value-types, i.e. provide *cppSelf. This greatly increases the number of classes where operator<<() provides useful results. Also make sure to check for operator<<() in namespaces (recursively), not just at global scope. Change-Id: Ief9158455a25e332f07169f09692cafb8097078b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix the registry after mergingChristian Tismer2019-10-301-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 5.13 we did not check the registry. By change https://codereview.qt-project.org/c/pyside/pyside-setup/+/278244 more functions are generated, which are not yet in 5.14 . By repeating the removal of that patch, together with the recreation of the registry files, we add by hand what the merge could not do automatically. This took quite a while to understand :-) "SharedPtr" and maybe other classes may create an infinite recursion via some "._gorg" property from the typing module for Python 2.7 . We simply skip that effect. Change-Id: I85568b08bb6ac87b5dbf6a2823e4a71f69f8b4ad Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Improve the NumPy Support by iterablesChristian Tismer2019-10-309-8/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Working example, by overriding cppgenerator: >>> from PySide2 import * >>> QtCore.QUrl.fromStringList(("asd", "def")) [PySide2.QtCore.QUrl('asd'), PySide2.QtCore.QUrl('def')] >>> def func(lis): ... for thing in lis: ... yield thing ... >>> QtCore.QUrl.fromStringList(func(["asd", "def"])) [PySide2.QtCore.QUrl('asd'), PySide2.QtCore.QUrl('def')] Also working, by overriding shibokengenerator >>> QtGui.QMatrix4x4(func(range(16))) And all other QMatrix sizes as well: >>> QtGui.QMatrix2x2(func(range(4))) >>> QtGui.QMatrix2x3(func(range(6))) The PySequence cases seem to be quite completely covered. Supporting lists and QVector is not yet clear and needs more research. Note.. QtOpenGLFunctions is not tested at all and nothing works on macOS, segfault. Ignored for now! A simple numpy test shows how versatile this solution is. We now need to improve signatures and error messages to optimize the experience. Task-number: PYSIDE-795 Change-Id: I195cd46cf47c2eb83276fe48fce8e6070cf30fda Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Properly nest types in type system filesFriedemann Kleint2019-10-284-53/+63
| | | | | | | | | | | | | | | | | | | | | | | | Nesting types by specifying "::" currently works by coincidence (as long as no modifications or further elements apppear) since the lookup is mostly name-based. It might be removed in a follow-up step. Task-number: PYSIDE-990 Task-number: PYSIDE-1074 Change-Id: I43db8a25a192e94b6a6d51f78233c3526f719406 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Friedemann Kleint2019-10-181-5/+8
|\| | | | | | | Change-Id: I04187b70448808519c92bbb46b09d58e8babc3b3
| * Shiboken: QtDoc generator: Handle 'group' tag as a 'page' tagVenugopal Shivashankar2019-10-151-4/+6
| | | | | | | | | | | | | | | | Also, add a title for the resulting rst either using the fullTitle or the title attribute. Change-Id: If8be6a9a6db2cfc86bc4b646159ccc6f2210e243 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Shiboken: Provide a context for the additional docsVenugopal Shivashankar2019-10-071-1/+2
| | | | | | | | | | | | | | | | | | Without the context, the images referred in the additional docs are not copied to the target directory. As as result, we have missing images in the HTML. Change-Id: I76bf4dafaa9ff82ef11755a64da7466596969460 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Friedemann Kleint2019-10-089-7/+58
|\| | | | | | | Change-Id: Ibe15176ae36ea31bd1799d9bf8a39b57f9338ca0
| * shiboken: Fix handling of modified default expressionsFriedemann Kleint2019-10-046-5/+48
| | | | | | | | | | | | | | | | | | | | - Do not try to resolve modified default expressions (add enumeration scopes or similar) - Fix the signature parser to handle arbitrary expressions Fixes: PYSIDE-1095 Change-Id: I059c3a1f066687d7c2f0dad9ea7f0d93e292b1b5 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix bad shutdown effect on QApplication.instance()Christian Tismer2019-09-301-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When app = QtWidgets.QApplication.instance() is used before a QApplication has been created, the qApp code sees no qApp instance in C++ and assumes a shutdown. This patch keeps track of QApplication being created and behaves correctly on that aspect. It is still unsolved that QtCore.QObject.staticMetaObject gets deleted on a qApp shutdown, which is too much. I think this can be handled in another patch if at all, since the shutdown / recreate feature is undocumented and of little use. Change-Id: I140b6dba45f7cd337580373dbf72bc6d0a625fea Fixes: PYSIDE-1093 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Remove trailing whitespace from __repr__Andreas Beckermann2019-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDebug normally prints a trailing ' ', however the repr implementation does not expect so. Remove the trailing space, if it is there. This makes sure that e.g. PySide2.QtCore.QRegularExpression() is printed as <PySide2.QtCore.QRegularExpression("", QRegularExpression::PatternOptions("NoPatternOption")) at 0x1067a5d20> instead of <PySide2.QtCore.QRegularExpression("", QRegularExpression::PatternOptions("NoPatternOption")) at 0x1067a5d20> (note the double space before 'at') Change-Id: I6c088069a6a8ca42933a442cce7b576327a9d151 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Shiboken: Add check for 'external' link typeVenugopal Shivashankar2019-09-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | Apparently, qdoc generates <link...> entries with 'external' type, which is ignored by Shiboken. This leads to treating such links as reference links, leading to broken links in the HTML output. Change-Id: I426f91661ba1cc0b0f17b2e30fbddcf9e1fee530 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-09-111-0/+1
| |\ | | | | | | | | | Change-Id: I7f3e2a11fe744b5c868698e63cf10882c168c53f
| | * Fix heaptype conflict with QtCore.QObject.__new__in Python 2.7Christian Tismer2019-09-061-40/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patching of the type generation needs to become universal. Additional to the patch for SbkObjectType_TypeF, we now patch * SbkObjectTypeTpNew * introduceWrapperType which makes the modifications for the heaptype flag complete. Actually, the modification of tp_new_wrapper has to be more sophisticated in this general case: We follow the __mro__ and patch exactly those functions which have the old wrapper and add the new wrapper. Change-Id: I51d4d77c99bd18eed2e31d2ab21143c0f4e2ea6c Fixes: PYSIDE-1051 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit cd6172063756a59e02f1a7857bc60a1737214ad1)
| | * Bump version for 5.12.5Simo Fält2019-08-271-1/+1
| | | | | | | | | | | | | | | Change-Id: I741a7880bf87cca4a6482cc0e07e6f878e2e02b3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * | Bump version to 5.13.2Simo Fält2019-09-061-1/+1
| | | | | | | | | | | | | | | Change-Id: I4e65ab4e24d563372e548f426b830a9490b8e99f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | shiboken: Remove ShibokenGenerator::getDefaultValue()Friedemann Kleint2019-10-043-29/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace by AbstractMetaArgument::hasDefaultValueExpression(), which is now restricted to the effective default value expression after the previous commit. This effectively reverts 96bd943d57b1864d1f5e7359b100c67d01934619 for the old bug 919, which was trying to re-apply the modifications again, potentially hitting on a remove modification in a loop. Task-number: PYSIDE-1095 Change-Id: I08fc005cfdc2f7b91f8303abd4d75a479d670ba9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | | shiboken/AbstractMetaArgument: Separate functionsFriedemann Kleint2019-10-042-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split out AbstractMetaArgument::hasOriginalDefaultValueExpression() and restrict AbstractMetaArgument::hasDefaultValueExpression() to the effective (removed/modified or original expression). Use hasOriginalDefaultValueExpression() since the affected code is only interested in whether the code has a native default expression. Task-number: PYSIDE-1095 Change-Id: I043ae99c315a8a41295efc2c4a15cd5a6ce74293 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | | shiboken: Streamline code for argument default value modificationFriedemann Kleint2019-10-043-90/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out a helper for applying the modifications and use that in AbstractMetaBuilderPrivate::traverseFunction(AddedFunction) and AbstractMetaBuilderPrivate::traverseFunction(FunctionModelItem) consistently using the existing list of function modifications. Streamline AbstractMetaBuilderPrivate::fixDefaultValue() to handle empty expressions for simplicity. Remove AbstractMetaFunction::replacedDefaultExpression() and AbstractMetaFunction::removedDefaultExpression() which are no longer needed. Remove unused AbstractMetaFunction::argumentReplaced(). Task-number: PYSIDE-1095 Change-Id: I649d8aa4d2ecc8bd551ecf57303ab9b849757029 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | shiboken/Sample test: Remove ambiguous modificationFriedemann Kleint2019-10-031-1/+0
| | | | | | | | | | | | | | | | | | | | | The default expression should either be removed or replaced. Change-Id: I54fcf1f4890610f5f5e87f191832deee33dd0561 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | | patch_tp_new_wrapper(): Add an assert for the "__new__" entryFriedemann Kleint2019-10-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The entry should be present, unless there is some mistake in the string creation functions. Task-number: PYSIDE-1087 Change-Id: Idbcf651be5daf2048f1a6845dd93bdcd9700e63b Reviewed-by: Christian Tismer <tismer@stackless.com>