aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
Commit message (Collapse)AuthorAgeFilesLines
...
* | shiboken: Do not generate smart pointer templates in namespacesFriedemann Kleint2019-12-111-1/+1
| | | | | | | | | | | | | | | | std::shared_ptr would cause a wrapper to be generated within std. Task-number: PYSIDE-454 Change-Id: Id370d74fce6aaa0a3dddfa511b9373a95a39f373 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Improve error message about not finding smart pointersFriedemann Kleint2019-12-111-2/+4
| | | | | | | | | | | | | | | | List target lang name and C++ name. Task-number: PYSIDE-454 Change-Id: Ie3d17dd3cc2ed0334f032e9a918fb1930e8ae61f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Test setters/getters of classes held by smart pointersFriedemann Kleint2019-12-104-6/+24
| | | | | | | | | | | | | | | | Add a setter/getter to the pointee. Task-number: PYSIDE-454 Change-Id: Ia6978300846ff82d8061df9f27c3fbd0c8e71b2f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Refactor the generated getattro()-methodFriedemann Kleint2019-12-101-75/+57
| | | | | | | | | | | | | | | | Remove else after return and simplify accordingly. Replace the check for self by an assert. Change-Id: I219e4887f0a699c21f718563ac696baf4c7f9d73 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | libshiboken/introduceWrapperType(): Emit warning on failuresFriedemann Kleint2019-12-101-2/+13
| | | | | | | | | | | | | | | | | | Emit a warning when PyModule_AddObject(), SbkSpecial_Type_Ready() fail, which can happen when passing the wrong parent. Task-number: PYSIDE-454 Change-Id: I0c2da7292dc0a354c58a21bf4a1df9d350d15ab6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Fix usage of Qt's endl, preparing for Qt 6Friedemann Kleint2019-12-0611-1091/+1077
| | | | | | | | | | | | | | | | 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>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Friedemann Kleint2019-12-0511-18/+180
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2019-12-0511-18/+180
| |\| | | | | | | | | | Change-Id: I779defc33a4bab15cfde1e276d6d78c476a47e0f
| | * Optimize the Python 3.8 refcount fix a tiny bitChristian Tismer2019-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change uses the fact that our workaround to temporarily remove the Py_TPFLAGS_METHOD_DESCRIPTOR flag uses the "mro" function of PyType_Type, which never will change. Therefore, the static keyword makes sure that this function lookup happens only once. Change-Id: I44b74556da1fac2596c81339af30cb66218276e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Fix Python 3.8 problemsChristian Tismer2019-12-0510-16/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes some refcounting problems with Python 3.8 . One incompatible change was announced in the what's new document, but actually there were two more problems which were not explicitly mentioned but took much time to sort out. The patch is compatible with the limited API changes (tested with debug build and API error disabled). It is also independent of the Python version which is full Limited API support. For more info, see the documentation mentioned below. The flag error is circumvented now! We either find a better solution or leave it as it is. For now this is ok. Fixes: PYSIDE-939 Change-Id: Iff4a9816857a6ebe86efd4b654d8921e4e464939 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| | * New documentation structureCristián Maureira-Fredes2019-12-031-2/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New structure for the landing page, - Some rst were renamed to the new structure, - New sections "Videos", "Examples" and "Getting Started" were created, - Information from the wiki was used to create the Getting Started sections, - FAQ section was removed, - Removing pyhtml2devhelp.py since it is unused, - The new CSS modifications were copied over the Shiboken2 directory. Task-number: PYSIDE-1067 Change-Id: I1ba53cd0030d6d02449fecdfea70efb49421ad3b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com>
* | | shiboken: Add a way of specifying system includes to be parsedFriedemann Kleint2019-12-058-1/+61
|/ / | | | | | | | | | | Task-number: PYSIDE-454 Change-Id: I9302cf74544315875a65bc09b75741c7fe6399e8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Fix passing of the parent type to smart pointer init functionsFriedemann Kleint2019-12-054-19/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | The code was assuming that smart pointers instances live in the global namespace and passed the module as parent, which does not work in case of std::shared_ptr. Factor out the code writing the init function call and use the same code for classes and smart pointer instances. Task-number: PYSIDE-454 Change-Id: Iffe5ace31d734dd19ca784841344c50248952342 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | shiboken: Handle inline namespacesFriedemann Kleint2019-12-038-1/+45
| | | | | | | | | | | | | | | | | | Check the attribute as returned by the clang parser and add it to the handling of the visible attribute of namespaces. Fixes: PYSIDE-990 Change-Id: I3428b59d6d9a5d60dd95db5fc0640772bd3985c8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | 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>