aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/support/signature
Commit message (Collapse)AuthorAgeFilesLines
* Improve the QByteArray implementationBoxiang Sun2018-06-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The available constructors for QByteArray are now: bytes, bytearray, and QByteArray, unicode is not accepted anymore. Also the concatenation is now possible between QByteArrays. Even though is not possible to initialize a QByteArray with an unicode, we include the possibility to compare it with one (Compatibility with PyQt). The __repr__ and __str__ are now properly working. There seemed to be a confusion regarding data types between Shiboken, Python2 and Python3 related to bytes, so now the structure is based on the flag SBK_BYTES_NAME, which is define as "bytes" for Python3 and "str" for Python2. Many tests were modified to properly handle string, using the `py3kcompat` module. Task-number: PYSIDE-232 Change-Id: I8b671f367c60a0870c72dcbe5662106b3225037d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use SPDX name / ID for python licenseKai Koehne2018-05-222-2/+46
| | | | | | | | | | | | | | | | | This is the standard name of the license. See also https://spdx.org/licenses/Python-2.0.html Note that there's some deviation in the actual license text: The text refers to the exact Python version. Also, the SPDX standardized license contains additional text for some modules. Still, it's better to use the standardized name than inventing our own one. Change-Id: I64b20bc558928ca28edaf81925a049fcaeb124b6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change license from all the filesCristian Maureira-Fredes2018-05-039-9/+9
| | | | | | | | | | | | | | | | | 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-279-9/+9
| | | | | | | | | 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>
* Fix qt_attribution.jsonFriedemann Kleint2018-04-181-0/+12
| | | | | | | | | | | | | | - Move from root to sources/pyside2/PySide2/support/signature - Set "QtForPython" as module name, fixing the qtattributionsscanner warning: File ./qt_attribution.json: Missing mandatory property 'QDocModule'. - Use "Qt for Python" as in descriptions - Reference backport_inspect.py as file Task-number: PYSIDE-363 Change-Id: I5e2b546a0a2a090abebc73a38ca4077a2983f216 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Augment signature mapping for 5.11Christian Tismer2018-02-261-1/+3
| | | | | | | | | There is some new structure that is not yet supported. I hope this works because I have no installation of 5.11. Change-Id: I310bfc4f20d33b2a6511ce59a4d68aec971a4128 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-02-231-1/+13
|\ | | | | | | Change-Id: I5d1a4734e8f44785898ba62beaa0bdd2004fca22
| * Signature: make the parser more complete for 5.11Christian Tismer2018-02-231-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser regex could not handle angle bracket pairs with commas in it. This is needed for template parameter lists. When they contain commata between the angle brackets, the parser did not recognize that. This fix allows for one level of angle brackets with whatever content. It will probably be needed in 5.11, but the syntax that the regex recognizes should always be complete. I had a hard time to understand this split regex again, so I added some more documentation, and it should now be simple to extend it even more. Task-number: PYSIDE-510 Task-number: PYSIDE-616 Change-Id: Ic854852f35af8b4526a63ffe920f2c01204c1f31 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-292-1/+2
|\| | | | | | | Change-Id: Ibef497a2439a05114eb2123e5f39c00aec8dc460
| * signature: Support a new constant for QOpenGLChristian Tismer2017-11-282-1/+2
| | | | | | | | | | | | | | | | | | | | | | There are QOpenGLFunctions::glGetString() etc. Some platforms have new, unrecognized constants. I also reverted a change to parser.py to accept all regular exceptions, again. It makes little sense to be explicit, here. Change-Id: I7e0289ed074c1452ad163f68fdc6d35f046844e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-11-277-170/+2455
|\| | | | | | | Change-Id: I79637555fbfbd596dee4313baf80149d03bb5206
| * Create a function existence registryChristian Tismer2017-11-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. The linux2 and linux platforms are now unified. There will be a new version of testrunner.py which is more versatile. In future, this teach-in process will be made much easier because we will be able to view the initial versions without raising an error. Done: linux 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Done: darwin 5.9.3 Done: linux 5.9.3 Done: win32 5.9.3 Task-number: PYSIDE-510 Change-Id: I4e3953f9d8e781ae170b455dc7884da9bf632f47 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Create a function existence registryChristian Tismer2017-11-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. Done: linux2 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Done: darwin 5.9.3 Task-number: PYSIDE-510 Change-Id: Ib366f60d527ee8b043c7ee16430fdda42c707cfe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Create a function existence registrymaya1Christian Tismer2017-11-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the signature module, it is now a straight forward task to generate a registry of all known function signatures. We check that these signatures all exist. One file contains all signatures for one platform and version. The test is only activated when run in the CI system. An initial call creates the expected file as output and raises an error. The result can then be picked up from the error log and added to the repository. Done: linux2 5.6.4 Done: darwin 5.6.4 Done: win32 5.6.4 Task-number: PYSIDE-510 Change-Id: I4f406cf72d25fdd2336814f6f20129079b8be54f Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Update and complete the signature moduleChristian Tismer2017-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | This is a small omission that showed up after generating many signatures. It also has support for "PySide2.QtCore.unsigned char" which came with the introduction of QOpenGLFunctions::glGetString() Task-number: PYSIDE-510 Change-Id: Ic07240cd29d423370717e8b76d0ab2e2b50402bd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Update and complete the signature moduleChristian Tismer2017-11-145-166/+2447
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is now an external typing module for Python 2.7 and Python 3.6 from Guido (PSF license again) that makes the differences between both versions vanish. Also, when generating interface files, some types did not show correctly, and the constant "0" is wrong in almost all cases. Values in signatures looked often bad since they have no nice __repr__, and it was almost impossible to create correct .pyi files. Now, these instances are created as wrapped string types with a nice __repr__. A call of these objects creates the real constant. This way, also objects can be rendered which are dependent from the existence of other objects (i.E. QPixMap). This patch improves the usability of the signature module. We can now generate source code or .pyi files without modifications. Task-number: PYSIDE-510 Change-Id: I55490d76a29fc6c0e4f821c0c77d5e5d1e28976e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2017-10-272-5/+6
|\| | | | | | | Change-Id: I94cb5a7dab97cff3591bac534228bfd3e3ad5938
| * Fix the signature of the Q*Application constructorChristian Tismer2017-09-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Signature: tiny refinement in ReloaderChristian Tismer2017-09-291-3/+3
| | | | | | | | | | | | | | | | | | This is totally irrelevant and a tiny optimization that is really not needed. Do what you want. Task-number: PYSIDE-510 Change-Id: I5d6d2f5f94130d4b03b4d70525b35139e82b9f5e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Signature: Fix missing constant for 5.10Christian Tismer2017-10-131-0/+1
|/ | | | | | | | | There is a crash in 5.10 because a signature is not recognized. This is only a warning, but turned into an error for the testing. Should we drop that, eventually? Change-Id: Idd183842575e3890b018c8bc82b6e272e2980b9d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Signature: support the new types and constants of 5.9 part 3Christian Tismer2017-09-281-0/+1
| | | | | | | | This patch adds a type to MSVC. Task-number: PYSIDE-510 Change-Id: I3290c91cd6f2937bddf8ec1f673b4a672bc49db3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Signature: support the new types and constants of 5.9 part 2Christian Tismer2017-09-282-0/+78
| | | | | | | | | 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: support the new types and constants of 5.9Christian Tismer2017-09-271-2/+23
| | | | | | | | | This patch covers macOS and Ubuntu (which actually had one addition). No idea how oftem we must iterate ;-) Task-number: PYSIDE-510 Change-Id: I950c57c2d225b289eafc46e7f1758338b4d62838 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Signature: Improve error reportingChristian Tismer2017-09-251-6/+1
| | | | | | | | | | | | It is likely that with Qt 5.9 we get new signature text that is not recognized. This becomes a problem because COIN takes much time. This patch does not stop on the first parser error, but collects all warnings and raises an error at the end. Task-number: PYSIDE-510 Change-Id: I898e0a7a59e8313c115d7ce8160908bf85d4140c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Signature: Simplify parser by not reloading mappingChristian Tismer2017-09-253-154/+97
| | | | | | | | | | | | | | The mapping had been reloading on demand. This is overkill, since we only want to initialize the new constants. This patch replaces reloading by explicit init functions. This simplifies the parser and even the loader, because sys.path is no longer relevant and no context manager is needed for a single sys.path patch. Task-number: PYSIDE-510 Change-Id: I9e3a45cb10570211183952bd517abb0084b94f47 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Implement introspection with __signature__ packageChristian Tismer2017-09-208-0/+7423
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* remove pyside2 and shiboken2 submodulesOswald Buddenhagen2017-05-221-15/+0
| | | | to be replaced by a subtree merge.
* update: bring repositories back in syncChristian Tismer2017-02-151-6/+12
| | | | | | | From time to time, it is good to update the master project. Change-Id: I50c45caf7c37ebb4ea865b4e4f5896e5cd8915fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update the pyside-setup submodulesChristian Tismer2016-12-121-10/+6
| | | | | | | | | | From time to time, submodules need to be updated. Actually, I would even like to update the master module after every submodule checkin, but this seems to be not easy to do all the time. Change-Id: I52f266c58086186df05ddcc85085f35e2e28ead7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Accept more errors in "testrunner.py"Christian Tismer2016-11-031-25/+10
| | | | | | | | Testrunner has even more variable texts to recognize. We change the regex slightly so that it always succeeds. Change-Id: Iac156592aac48afb5aea522540ae63c92ca2572a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix OS/X inclusion of framework headers.Alexandru Croitor2016-06-161-6/+25
| | | | | | | | | | | | | | | | | | | | | The recent change that made use of framework headers on OS/X did not work with homebrew Qt, and it didn't work with official builds either, because neither of the chosen include folders contained all the necessary headers to lead to a successful build. Fortunately shiboken actually supports being passed multiple include locations, separated by a colon on OS/X, and a semicolon on Windows. This patch makes sure to always pass the Qt include folder, and in case if the Qt build is a framework build, also passes the root frameworks location, with headers found by shiboken under frameworkName.framewework/Headers. This works for homebrew builds, official builds and custom non-installed prefix / in-source builds of Qt. Change-Id: I47b24e197839883de2ab873461efc1f4d4d33743 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add option to link with libc++ on older OSX versions.Alexandru Croitor2016-05-111-5/+8
| | | | | | | | | | | | | | Versions of OSX lower than 10.9 link libstdc++ by default. Also libstdc++ is linked when the osx minimum deployment target is lower than 10.9. The new option allows explicitly linking libc++ in the cases mentioned above. It is not enabled by default, because most libraries and executables on versions lower than 10.9 are compiled with libstdc++, and mixing standard library versions can lead to crashes. Change-Id: I7397d2bbce2cfceaeb848f25e0bbf1a24ac9bde8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* fix the name pyside2uicChristian Tismer2016-04-191-8/+5
| | | | This was modified, but not corrected in setup.py
* updateChristian Tismer2016-03-011-7/+7
|
* updateChristian Tismer2015-12-291-5/+8
|
* move other readme files from pyside2 into the wikiChristian Tismer2015-12-131-8/+5
|
* merge all PRs unto #44 with updated wiki statusChristian Tismer2015-12-131-5/+8
|
* add project status to the wikiChristian Tismer2015-11-241-8/+5
|
* merge all until #33 inclusiveChristian Tismer2015-11-231-6/+8
|
* merge #21 #22Christian Tismer2015-11-151-8/+6
|
* Merge pull request #20 from empyrical/ws_fix_2Christian Tismer2015-11-141-7/+7
| | | | Add forgotten files to WebSockets module
* Merge pull request #19 from empyrical/ws_fixChristian Tismer2015-11-141-7/+7
| | | | Fix up the QtWebSockets module
* merged PR #15 #16 #17 from empyricalChristian Tismer2015-11-141-5/+8
|
* Merge pull request #16 from empyrical/qmlChristian Tismer2015-11-131-5/+5
| | | | Add Qt5 QML modules
* some tests correctedChristian Tismer2015-11-121-10/+5
|
* Fix pysidetest. We are at 74% good tests.Christian Tismer2015-11-101-7/+9
| | | | | | | As Romain correctly told me, QtCore is needed to be included. The other small bug with huge effects was a forgotten rename of pyside2_global.h. The tests now run without segfaults!
* after signals were fixed, we have the first working alpha that is able to ↵Christian Tismer2015-11-071-7/+8
| | | | show windows!
* merge the new signal supportChristian Tismer2015-11-071-0/+8
|