aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
Commit message (Collapse)AuthorAgeFilesLines
* shiboken: replace first()/last() by constFirst/constLast()Friedemann Kleint2018-01-177-62/+59
| | | | | | | | Fix clazy warnings about possibly detaching containers. Change-Id: I3c3a229de5e0c71f17c1f26273e1b0be3b0d7e81 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Fix some clazy warningsFriedemann Kleint2018-01-1712-60/+45
| | | | | | | | | | | | - 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>
* Add quotes to Shiboken cmakeCristian Maureira-Fredes2018-01-161-1/+1
| | | | | | | | | For paths containing spaces, the lack of quotes will make the process to fail. Task-number: PYSIDE-169 Change-Id: Iee99eb4fe6ed1045b7c6053ef199c49714fab32f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Prevent infinite loop due to bad __getitem__ implCristian Maureira-Fredes2018-01-151-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looking at PYSIDE-441 there was an issue regarding overloading the __getitem__ method on a class that inherits from QObject. The bug report showed that setting an object of the same class to be the parent of another object of the same class ended up causing an infinite loop when trying to get the parent element. Overloading __getitem__ implicitly converts the class into an iterator, and the developer *must* include a proper implementation of the method which raises a StopIteration exception when needed. Commonly, people that overload this method included access to class data structures where in most of the cases an IndexError is raised which forces the iteration to stop. Since the bug report did not include this code and also there was no access to any internal variable, no exception was raised and ended up causing an infinite loop. This can be replicated in python as folows: class A(object): def __getitem__(self, arg=None): print("getitem called:", arg) #raise StopIteration a = A() print(list(a)) This small fix avoids the infinite loop when the method __len__ is not implemented (length = -1) or when the length of the pyObj is zero. Without a proper implementation of __getitem__ (Raising IndexError or StopIteration) the infinite loop will happen. If __len__ is not implemented, then the application will complain, but does not matter since this is never checked during the iteration. Change-Id: I74e7bf1755c265dbc309bb6c5a760f11643fd7ed Task-number: PYSIDE-441 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix system header inclusions for proper support of C primitive typesAlexandru Croitor2018-01-151-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | In order for GL types like GLint64 to be available on macOS, the macOS-specific system header "gltypes.h" has to be parsed by libclang. Before this change, shiboken skipped parsing system headers (except for gl.h) because there are issues when trying to parse C++ std headers (ostream for example). The file "gltypes.h" contains the typedef declarations for GL numeric types. A few other system headers like "cstdint" are also needed (which contain the actual typedefs from int32_t to int for example). A few different system headers are also needed on Linux (also for GL -> numeric typedefs). This system header exclusion mechanism is far from a clean solution, but it seems like current versions of libclang do not provide enough preprocessor information to be able to limit the parsing to specific chunks of code (for example everything included by gltypes.h), thus we need to limit ourselves to exclusion by file paths. Change-Id: I58c151e2cb083e16f7cafb3dc9df2d757442bb59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix system framework handling on macOSAlexandru Croitor2018-01-151-4/+8
| | | | | | | | | | | | | | | | | | System framework paths queried from the system clang compiler should be re-added to libclang via the -iframework command line argument instead of -F, so that they appear at the bottom of the list of candidate include search paths. This prevents issues with picking up incorrect headers, like an installed official package of Qt 4.8. Also there is no need to use CMAKE_SYSTEM_FRAMEWORK_PATH like in the 5.6 branch because it duplicates the list of includes and also causes conflicts with the same paths being added as both system and non-system include paths. It was necessary in 5.6 branch because the list of include paths was not queried from the clang compiler. Change-Id: I04b299fc5bc759842a0ab890a85170f153932e79 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove old license header templatesFriedemann Kleint2018-01-125-139/+0
| | | | | | | | License header templates should be at the top if at all. Task-number: PYSIDE-363 Change-Id: If9e2f6631b478b9a1a991682a6f52dce1a04e2dc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* libshiboken: Recover from numpy import failuresFriedemann Kleint2017-12-211-3/+3
| | | | | | | | | | Clear the Python error on failure. Note that PyErr_Occurred() is not set for some reason in that case. Task-number: PYSIDE-580 Change-Id: I5672b9f5bf98e3d409abb4132f2face060826a0a Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove attributes Final and FinalInCppFriedemann Kleint2017-12-213-37/+17
| | | | | | | | | | Apparently, the meaning of FinalInCpp for functions was "virtual and not private". The previous code cleanup removed most uses of them. For the remaining cases, checking for virtual is sufficient. Change-Id: I6f794e36b99920af36fd0eba895be673dc35d9dd Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Remove unused code in abstractmetalang.hFriedemann Kleint2017-12-213-547/+25
| | | | | | | | | | | | The AbstractMeta* classes had a lot of functions trying to determine whether wrapper functions/classes should be generated. Apparently at some stage, this functionality was moved to the generator classes (apparently in conjunction with the "protected hack"), leaving the functions unused. Change-Id: Ia3fef96fe86cc6a6f9c70c674635bccf510362bc Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-12-211-1/+1
|\ | | | | | | Change-Id: I78039827d32c1d4d540a8b1b2afd4841e40d5c2c
| * Unify signature registry for py2 / py3 and clean upChristian Tismer2017-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turned out that there are tiny differences between Python2 and Python3 which make the versions of the registry almost, but not totally equal. There are functions which are slot wrappers in Python2 instead of method wrappers in Python3, and we currently don't support slot wrappers. There are other tiny differences when we switch to Qt 5.9, too. Initially, I thought to split the files for Python2 and Python3, but then it turned out that the problems vanish when we ignore the 'next' and '__next__' functions in both python versions. The filter function is both applied to the generating function and the testing function. Therefore we can keep the existing data intact. I further removed an indentation leftover in cppgenerator.cpp, fixed handling of duplicate entries and improved modularisation of the signature enumerator and formatter. This part will later be moved into the signature library. Task-number: PYSIDE-510 Change-Id: I18f5e8f08fb9b07534003919abe55ab4dafeb2c2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken/AbstractMetaBuilder: Remove create* functionsFriedemann Kleint2017-12-092-59/+15
| | | | | | | | | | | | | | | | There are no classes deriving from AbstractMetaBuilder, so there is no need to have virtual creation functions. Change-Id: I2d4c494ac6b0a17ceea71939a1f07a49a369df73 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken: Stop using the FinalInCpp attribute for classesFriedemann Kleint2017-12-093-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides its use for functions, the FinalInCpp attribute was used for classes meaning something like neither the class nor its derived classes can be constructed due to presence of private destructors and absence of non-private constructors. Since 'final' is now a reserved word in C++ 11, this becomes confusing. Remove the usage of the attribute for classes, add a bit field indicating presence of a private constructors and a new function isConstructible() instead. Change-Id: Ieb2f9943c21511e4f59d228885361e3ad66fb266 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Refactor copying of the MetaLang* classesFriedemann Kleint2017-12-062-11/+35
| | | | | | | | | | | | | | | | | | Disable copying of the base classes AbstractMetaAttributes and AbstractMetaVariable and refactor the copy() functions of the derived classes in terms of protected assign*() functions. Change-Id: I6cbe1cfa02207230e914ad41dddba46c866cb689 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Unify constructors of the MetaLang* classesFriedemann Kleint2017-12-052-108/+110
| | | | | | | | | | | | | | | | | | Use member initialization where possible. Move constructors/destructors of classes in hierarchies out of line (fixing Clang warnings about classes having no virtual out of line methods). Change-Id: I511e7261a077db259e6c305cb1dcb08c1ee4810f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Refactor typesystem modification structsFriedemann Kleint2017-12-055-187/+75
| | | | | | | | | | | | | | | | | | | | | | - Use member initialization where possible - Make constructors explicit - Remove unused version attributes, unused comparison operators of FunctionModification and unused struct ExpensePolicy - Rearrange members to minimize Clang warnings about padding Change-Id: I1423f120b2117237c2674cdbb6d06923c842999f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Do not use QString::split() to find nameFriedemann Kleint2017-12-051-3/+10
| | | | | | | | | | Change-Id: I83e254a5d0f7ba4613a04a73683ed08c273fc2ca Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Generate override instead of virtualFriedemann Kleint2017-12-051-11/+8
| | | | | | | | | | Change-Id: Ifcbabe09665c33daf5dd8d5df52036598c9f428f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Cleanup of the TypeEntry hierarchyFriedemann Kleint2017-12-042-260/+366
| | | | | | | | | | | | | | | | | | | | | | Use member initialization where possible. Move constructors/destructors of classes in hierarchies out of line (fixing Clang warnings about classes having no virtual out of line methods). Add override and move virtual functions out of line. Remove unused method ComplexTypeEntry *ComplexTypeEntry::copy(). Change-Id: Ie4a6c30cb0c99be35697f29ebe407b327079222a Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Do not generate wrappers for final classesFriedemann Kleint2017-12-045-1/+44
| | | | | | | | | | | | | | Check the attributes and add test. Change-Id: I6c3d76ed32b5d20b6940849dd4895f98abd62fca Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Do not generate wrapper methods for final C++ methodsFriedemann Kleint2017-12-022-4/+7
| | | | | | | | | | | | | | | | | | 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>
* | shiboken: Use information about virtual from the code modelFriedemann Kleint2017-12-022-3/+1
| | | | | | | | | | Change-Id: I27411e810fc3b3ff9d3bb629b5ebc2c7fdaa59ef Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken/MetaLang: Add information about override/finalFriedemann Kleint2017-12-024-20/+71
| | | | | | | | | | | | | | Take over information from code model and test. Change-Id: Ibed2973e09b117966ed241798125f60ba337b0e9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken/Clang parser: Add information about override/finalFriedemann Kleint2017-12-013-0/+51
| | | | | | | | | | Change-Id: I0f1bad0567ae928d4117e7785e7788d9efd551c2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken/AbstractMetaAttributes: Remove some unused attributesFriedemann Kleint2017-12-013-46/+3
| | | | | | | | | | | | | | Remove Native, FinalOverload, InterfaceFunction, Fake. Change-Id: I1232751169fafb144387343857a962bafee714e9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-274-4/+47
|\| | | | | | | Change-Id: I79637555fbfbd596dee4313baf80149d03bb5206
| * shiboken: Do not generate richcompare methods for namespacesFriedemann Kleint2017-11-243-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shiboken used to generate richcompare methods for namespaces when it contained free comparison operators for classes in that namespace, resulting in compile errors. For example: namespace Qt3DRender { bool operator!=(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample) ... Add a check preventing that. Task-number: PYSIDE-487 Change-Id: If2fa1de1bfb0fdc11c9415421dab0c7e13abc500 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Investigate the sporadic segfaults on RHELChristian Tismer2017-11-231-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lately, the RHEL platform tends to segfault between 0-4 times in a test run. I suspect that is related to some finalization code that is triggered at a special time, due to a stressy situation. But we don't know until we ask the CI system by printing a stack trace. This patch prints a stack dump after a segfault happened. The dump is only activated when the environment setting QTEST_ENVIRONMENT=ci is true. (The above needs to be compared with strcmp or strstr) Note that the tests _are not isolated_. I recognized that by the warnings module that leaked between tests. The processes are shared, unless you have setup and teardown functions. There might for instance be some hidden refcount bug that triggers only early enough in a stress situation. Change-Id: Ibbc592e7bdcbdd3cdbc06f203be3e5fc1daaf774 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Use the correct basename and extension for qdoc module filesTopi Reinio2017-11-141-2/+5
| | | | | | | | | | | | Change-Id: I0f123c3db5b50d193b927e8003771327d50ff344 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-131-1/+1
|\| | | | | | | Change-Id: Ib0f638130d21a5619f239a9fb8beb7d92ad8d0e8
| * voidptr.cpp: Assign bool directlyFriedemann Kleint2017-11-071-1/+1
| | | | | | | | | | | | | | | | Fix MVC warning: voidptr.cpp(90): warning C4804: '>': unsafe use of type 'bool' in operation Change-Id: I690becd76320d843e79a56ea792b65fa4cc9a498 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-0621-1175/+589
|\| | | | | | | Change-Id: I72583df407fc5b3caa8bf35fd997889a4ac86512
| * Implement proper void pointer (void*) supportAlexandru Croitor2017-11-0611-47/+547
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new type into the shiboken2 module which is imported by calling "import PySide2.support.VoidPtr". The type takes care of conversions from / to void* values in function signatures. Creating an instance can be done by passing either a shiboken wrapped object, or an integer representing an address, or a python object that implements the buffer interface. For example, this is useful for passing numpy arrays to C OpenGL functions that take void* parameters. First you convert the array into a bytestring (using numpy.array.tobytes(), then you instantiate a VoidPtr from that bytestring, and finally you pass it along to a GL function. One corner case that is currently not supported is void** parameters. Change-Id: I01e291d6856cb6bd8b5175adc3ead6b728036535 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Remove dead / unused code regarding conversionsAlexandru Croitor2017-11-0214-1126/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | shikoben2: Extend type system path resolutionFriedemann Kleint2017-11-034-11/+40
| | | | | | | | | | | | | | | | | | | | | | | | - Remove stripping of directory components from the file names so that for example QtCore/typesystem_core.xml can also be resolved via type system path. - In addition, pass in the path of the current file being parsed so that for example typesystem_core_x11.xml is found from the directory of typesystem_core.xml while parsing Change-Id: Id10aafaf21750aa87460ccfe9ee3c3764086eda6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Use latest version of llvm-configFriedemann Kleint2017-11-031-4/+23
| | | | | | | | | | | | | | | | | | | | When falling back to llvm-config, try to determine the most recent version by using a glob pattern to find the executable (llvm-config-3.8/3.9...) and checking the version it reports. Change-Id: I13b5aff09a6a2f8b95def0041176c1487749be1a Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-10-279-20/+316
|\| | | | | | | Change-Id: I94cb5a7dab97cff3591bac534228bfd3e3ad5938
| * Support the qApp macro correctly, final version incl. debugChristian Tismer2017-10-276-12/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For short the new features: - there is a qApp in QtCore, QtGui and QtWidgets for compatibility, and also in __builtins__ for a true macro-like experience. - if you delete any qApp variable, the Q*Application is reset and you can start over. Long description: There is a qApp macro in Qt5 which is equivalent to Q*Application.instance() . Python does not have macros. Both PyQt5 and PySide2 have an according structure in QtWidgets. In the case of PySide2, the qApp variable is first initialized to None and later to QApplication(). This does not reflect the original sense of the qApp macro, because - it only handles QApplication, - it does not handle destruction. This "macro" should live in QtCore, but both PyQt5 and PySide2 decided to put this in QtWidgets. As a compromize, I propose to put qApp into all three modules, and into __builtins__ as well, so wherever you create an application, you find this "macro" in place. While changing the code, I stumbled over the template set_qapp_parent_for_orphan. I tried to make sense out of it and finally removed it. There were no side effects but bug PYSIDE-85 is gone, now. With some extra effort, I created a singleton qApp that changes itself. This way, a true macro was simulated. Note that this was not possible with a garbage collected variable, and I had to make shiboken aware of this. As the final optimization, I turned qApp also into a fuse variable: Delete any qApp variable and Q*Application will finish when there is no extra reference. Task-number: PYSIDE-85 Task-number: PYSIDE-571 Change-Id: I7a56b19858f63349c98b95778759a6a6de856938 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix the signature of the Q*Application constructorChristian Tismer2017-09-293-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q*Application had PySequence as Parameter, although only QStringList is accepted. That resulted in an implausible error message when a list of, say, Integers was given. This patch - replaces PySequence by QStringList (one more tuple layer), - fixes QCoreApplication to give the same kind of error messages, - renames the shiboken function sequenceToArgcArgv to listToArgcArgv and changes it to only allow list descendents. We also changed signature.typing in one line to display List[str] correctly. I think this belongs more to PySide-331, a fixed qApp. Task-number: PYSIDE-510 Task-number: PYSIDE-331 Change-Id: Ib256c6a2db05a3db826454e1bf1b4729d59a240b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | shiboken: Add the c++ header include paths of g++Friedemann Kleint2017-10-251-0/+21
| | | | | | | | | | | | | | | | | | | | It seems standard C++ headers are not found by clang when run g++ 6.3.X on RHEL 7.4. Task-number: PYSIDE-431 Task-number: PYSIDE-513 Change-Id: Ibd400cfa854ce3a9f763c593969cd063346f8056 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | shiboken: Add Vulkan supportFriedemann Kleint2017-10-071-4/+17
| | | | | | | | | | | | Task-number: PYSIDE-431 Change-Id: I35995213d04a3fb7a6c8399b1397884cf43c09ba Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Add -Wno-microsoft-enum-value for MSVCFriedemann Kleint2017-10-071-0/+1
| | | | | | | | | | | | | | | | Silence numerous warnings: warning: enumerator value is not representable in the underlying type 'int' Change-Id: I82b4547c1392e1d65515e0bd51d5d76bac185a9e Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Signature: Remove pre 5.7 parts, fix coding styleFriedemann Kleint2017-09-292-16/+5
| | | | | | | | | | | | | | | | Complements 30a1c9c41e5e6d4166f171b9477c6f46cafa782f. Task-number: PYSIDE-510 Change-Id: I76e433dc35dbe88dbf254b19b82b8c392af0dad4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-09-289-19/+844
|\| | | | | | | Change-Id: I47521e21977b1f17fcc65590f565270b2440a48b
| * Signature: support the new types and constants of 5.9 part 2Christian Tismer2017-09-281-13/+2
| | | | | | | | | | | | | | | | | | This patch reduces the string size a bit to meet the MSVC restriction to 16k only. This limit is reached by QtGui/qopenglfunctions_wrapper.cpp . Task-number: PYSIDE-510 Change-Id: Ibb4a9103775cb308a0f39b3375c4948da6016189 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Signature: buglet makes clang complainChristian Tismer2017-09-251-1/+1
| | | | | | | | | | | | | | Some small oversight is now an error after the last clang update. Change-Id: I61b118d772cacdf7950e3b43e76cc4351c3062f3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Signature: fix documentationChristian Tismer2017-09-251-1/+4
| | | | | | | | | | | | | | | | There was some glitch that made a few sentences incomplete. Task-number: PYSIDE-510 Change-Id: Idd11c7a0d9f31aab4ab80e6fd6002f2320695ad5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Implement introspection with __signature__ packageChristian Tismer2017-09-209-19/+852
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature module was turned into a package under 'PySide2/support/signature'. The package is completely isolated so that nothing is leaking into the normal import machinery. The package is also not initialized unless a __signature__ attribute is accessed. The only change to Python during a PySide run is the existence of the __signature__ attribute. As a side effect, all tests run at the same speed as before this extension. The module does not actively import PySide modules. Instead, it inspects sys.modules and reloads its mapping.py if needed. Example usage: >>> PySide2.QtWidgets.QGraphicsAnchorLayout.addAnchors.__signature__ >>> PySide2.QtWidgets.QGraphicsAnchorLayout.__signature__ The module has been thoroughly tested on macOS. I consider this ready. Task-number: PYSIDE-510 Change-Id: Ibb231a7fbb4ccc1a7249df55e3881a4e21a19c0d Reviewed-by: Christian Tismer <tismer@stackless.com>
* | CodeModel: Handle access of inherited classesFriedemann Kleint2017-09-255-30/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Store the access of the base class in the code model. Remove protected/private base classes in the abstract meta builder as otherwise invalid code will be generated for classes like QAbstract3DGraph : public QWindow, protected QOpenGLFunctions when the protected hack is not in use (on Windows). Task-number: PYSIDE-487 Change-Id: I5bc2dad16f903da86e6e41450c2f9a76726ac028 Reviewed-by: Christian Tismer <tismer@stackless.com>