aboutsummaryrefslogtreecommitdiffstats
path: root/sources
Commit message (Collapse)AuthorAgeFilesLines
* Update pyside2-tools submoduleAlexandru Croitor2018-12-071-0/+0
| | | | | | Change-Id: I1aa12897a02ac70fb65a72160578732fdb179092 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Make quiet builds really quietAlexandru Croitor2018-12-072-13/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change does a couple of things: - Sets the distutils / setuptools --verbose option to 0 - Sets the distutils / setuptools --quiet option to 1 - The options above end up calling distutils.log.set_verbosity(0) - Passes the QUIET_BUILD cmake option from setup.py to every CMake invocation, when --quiet is passed to setup.py - Sets the CMAKE_INSTALL_MESSAGE variable to silence messages regarding installation of files - Sets the CMAKE_RULE_MESSAGES variable to disable progress report in makefiles when building each source file - Overrides the CMake message function, not to display STATUS / info / untyped messages (still displays warnings and errors) - Changes the build / install elapsed time messages to always be printed even in quiet mode - Reverts the previously introduced set_quiet function in utils, because log.set_verbosity() now takes care of silencing those messages As a result, there's a lot less clutter when doing a quiet build. Warnings, errors and shiboken output is still displayed. Change-Id: Ie05c593ce7dc0aa04554c2d2859ce655233ddb9f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Make it hard to use the create_pyside_module function incorrectlyAlexandru Croitor2018-12-0746-400/+376
| | | | | | | | | | | | Rewrite the function to use keyword arguments instead of ordered arguments. Also add error detection when required arguments are not passed, or have a typo in them. Adjust all the module cmake files to use keyword arguments. Change-Id: I7bb0c6561d7dca1e7f673e29eb457da50ae5df04 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Fix finding of the Clang lib dirFriedemann Kleint2018-12-051-6/+6
| | | | | | | | | | | | Query llvm-config for the lib dir instead of constructing the path from the prefix in case the Clang location is obtained via llvm-config. Assume a standard build in case the Clang location is obtained via environment variables. Change-Id: I7628d90706100a61f8a605e931bd023b27f1f442 Fixes: PYSIDE-867 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid DeprecationWarning in Python 3Cristian Maureira-Fredes2018-12-051-1/+1
| | | | | | | | | The re.match(...) string raised a DeprecationWarning due to the escaped '\(' inside the pattern in Python 3. Using a raw-string instead solved this issue. Change-Id: Ib7f6c66bfdaa03f154ce086abf7ca9bd0baaeb47 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Cast PyLongs to WIdCristian Maureira-Fredes2018-12-042-1/+26
| | | | | | | | | | | | QScreen.grabWindow and QWindow.fromWinId have an WId as an argument. WId is treated as a PyLong internally, but with methods that need a WId we need to manually transform them to long. Change-Id: I97651704f37ae268455990a13884b92e8f1b643c Fixes: PYSIDE-863 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Fix build with Qt 5.13Friedemann Kleint2018-12-041-0/+1
| | | | | | | | | | | Add missing include, fixing: sources/shiboken2/ApiExtractor/clangparser/clangutils.h:91:17: error: field 'childMessages' has incomplete type 'QStringList' appearing in Qt 5.13 due to some header rearrangements. Change-Id: Iab22538af8688ebb3dcbaf0e1042b1198bde5800 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Doc: Fix minor formatting and code-block issuesVenugopal Shivashankar2018-12-041-35/+38
| | | | | | | | Sphinx apparently doesn't handle XML block by default. Change-Id: I8892d96d072e718b345f444fdb7f6686c8ee14de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Generate Hinting Stubs AutomaticallyChristian Tismer2018-12-0311-112/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The script is now automatically called in the cmake build, as part of the create_pyside_module macro. The script runs after every module build and tries to generate .pyi files. This does not need to succeed, but will generate all files in the end. The script has been prepared to allow partial runs without overhead. After integration of the .pyi generation into cmake, these files are also installed into the install directory by cmake. For wheel building, setup.py has entries, too. Building a full project with all modules revealed a bug in the signature module that allowed unsupported function objects. Module enum_sig had to be changed to suppress types which have no ancestry in shiboken. PYTHONPATH was avoided because it was not Windows compatible. Instead, the script was changed to accept "--sys-path" and "--lib-path" parameters. The latter evaluates either to PATH or LD_LIBRARY_PATH. The necessity to create .pyi files while the project is in the build process showed a hard to track down error condition in PySide_BuildSignatureProps. Simple logging was added as a start of introducing logging everywhere. Task-number: PYSIDE-735 Change-Id: I6b3eec4b823d026583e902023badedeb06fe0961 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Move code to snippets and templatesCristian Maureira-Fredes2018-11-308-105/+143
| | | | | | | | | | | There was still leftover code on the typesystems but not all could be translated to snippets, so it was replace by templates. Task-number: PYSIDE-834 Change-Id: I7dbe2f15171ce6a60137be970312dc80622219c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Add an index page for ShibokenVenugopal Shivashankar2018-11-307-6/+280
| | | | | | | | Also document the samplebinding example. Change-Id: I2ee1fa6049ae672f5ab46df4d1eba411e69dc3c7 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move old glue code to snippets filesCristian Maureira-Fredes2018-11-3025-1315/+821
| | | | | | | | | | | | | | | | | Most of the old glue code was directly injected into the typesystem, so it was possible to add them as snippets. There are still a couple of header files that will remain there, because the include tag does not have the file/snippet tags. A few lines of code were modified in favor of "modern" C++, and good practices. Task-number: PYSIDE-834 Change-Id: I3072298b16d7280550c6a7f6abae045250663ba6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside: Refactor MetaObjectBuilderPrivate::parsePythonType()Friedemann Kleint2018-11-291-33/+26
| | | | | | | | | | | | | | - Use std::vector to collect the base types. Append the type first to avoid reshuffling when prepending. - Add properties immediately instead of storing in the 2nd loop as signals are already added. - Clang tidy: Use range based for, auto, nullptr Task-number: PYSIDE-784 Change-Id: I765beb2d09600e78abd314cbb394cd106ec22f03 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update old copyright messageCristian Maureira-Fredes2018-11-291-1/+1
| | | | | | Change-Id: I083fbeace177b627caef02fce1e738163461f91a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove TP from doc titleCristian Maureira-Fredes2018-11-291-1/+1
| | | | | Change-Id: I8d3fcc977b23f9efc20d9f3e073ad79f215769c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move add-conversion and native-to-target codeCristian Maureira-Fredes2018-11-295-275/+361
| | | | | | | | | | | Now we are able to include snippets for the previously mentioned typesystem's tags, so this patch removes the current C/C++ code from the typesystems. Task-number: PYSIDE-834 Change-Id: I2929020fa1dc0859db780dffb12fa292627697b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove some cmake dead codeAlexandru Croitor2018-11-291-16/+0
| | | | | | | | Some code was left over since the rewrite done in a80a6eb94433529a6d984e8ff22874f7dff48eea Change-Id: Ie862cea690dc54ad35d711b5fecfb58d51b03b88 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Place templates per moduleCristian Maureira-Fredes2018-11-2819-685/+868
| | | | | | | | | | | | | | | | | | | | | | | | There is a main template file that hosts most of the code-templates we use in the typesystems, but there were still several templates written in each module-typesystem file. The templates that are used on different typesystem are now placed in: sources/pyside2/PySide2/templates/core_common.xml Additionally, the templates used only by a certain module, are placed next to it, e.g.: sources/pyside2/PySide2/templates/widgets_common.xml Some simple templates were moved to the snippets files too. Task-number: PYSIDE-799 Change-Id: I4f355cf2ae983aba9e85414e910550189cd18dcb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* shiboken: Add file snippet handling to native-to-target and add-conversionFriedemann Kleint2018-11-283-5/+25
| | | | | | Task-number: PYSIDE-834 Change-Id: I3daad497ed32a56c05c8dc2b06271e243d579b99 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Fix file snippet code missing for derived classesFriedemann Kleint2018-11-282-35/+46
| | | | | | | | | | | | | Previously, the files were not read when no code was generated. This caused the code to be missing for methods in classes inheriting from a class in a dependent typesystem (for example, QAbstractSocket inheriting QIODevice). Split out the reading into a helper checking the attributes and always read the snippets. Task-number: PYSIDE-834 Change-Id: Iecc6285422afbf3b3e2ff4846850f8c2dbcabaf1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Install snippets glue codeCristian Maureira-Fredes2018-11-289-11/+78
| | | | | | | | | | | | | The module-specific glue files as well as the standalone glue files are now installed into the PySide2 package. The glue files are now also listed as dependencies for the shiboken generator run, which means that modifying those files will now correctly force a shiboken re-run for the relevant modules. Change-Id: I545c7ada379fafb7f225d0b0f5ce495bf6d4795d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QApplication::setStyle ownership transferCristian Maureira-Fredes2018-11-283-0/+19
| | | | | | | | | | | | | | Due to the nature of the qApp singleton, it was not enough to add the refcount of the style via the typesystem, as usual. An additional step of getting a reference to the qApp to set the parent of the style was required. A test case was included. Change-Id: I5e60983e961e7d3d310b1e1c2f6f9b80ee095308 Fixes: PYSIDE-861 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Exclude reverse operations from shift hackCristian Maureira-Fredes2018-11-275-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | An old fix for a QDataStream bug was performing an additional step related reverse operations, to make sure we call them if they were implemented in other classes. This was intended for shift operations. Classes like QVector*, QTransform, and others which include reverse operations like __radd__, and __rmul__ will include this patch too. When implementing a class that inherits from these types, this becomes an infinite loop, which can be solved applying this patch only for shift operations. Due to this change, a QMatrix and a shiboken test needed to be adapted. Change-Id: Ie399837b6435b2cd058648a15f4d5cdff037ac6b Fixes: PYSIDE-192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add documentation related QPixmap.loadFromDataCristian Maureira-Fredes2018-11-271-0/+12
| | | | | | Task-number: PYSIDE-840 Change-Id: I637186335123500013a265b8a6f6554dfdceb225 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Update copyright statements and obsolete infoTopi Reinio2018-11-264-8/+8
| | | | | | | | | Update the copyright statements visible in Shiboken2 and ApiExtractor documentation sets. Update the name of the Qt documentation tool. Change-Id: I09726e15a6b860f2698df683138a02683596d07d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update pyside2-tools submodule SHA1Friedemann Kleint2018-11-261-0/+0
| | | | | | | Includes latest change regarding ninja. Change-Id: I6169533c8019601031a5140d2a9f2387ff6bbebf Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix Hinting Stub Glitch and EnhanceChristian Tismer2018-11-261-26/+46
| | | | | | | | | | | | | | | | | | The argparse interface had a bug when started without "run" Parameter. Improved the formatting to be more close to PEP 8. Reworked parser to include "--skip" to skip existing output files and to ignore non-existing modules. This is to simplify file handling during automatic creation during a build. The automatic installer was extracted as an extra patch. This one should not be subject of a discussion. Change-Id: I3b6242b7cc459a7080bd8d48f4a37d4582eafb51 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Create hinting stubs for Python IDEsChristian Tismer2018-11-2412-11/+367
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation formats all signatures in a way that is known as type hinting files (.pyi). Usage ----- The script is to be called by the same Python interpreter that was used to build PySide. It works with Python 2 and 3. On Python 3, it performs a self-test. python3 sources/pyside2/PySide2/support/generate_pyi.py run will generate .pyi files for all compiled PySide modules and places them into site packages to the binaries. An optional outpath can be specified. It is planned to call this script automatically after install. o Local constants are not included, yet. Maybe they never will, unless requested. o The keyword "from" appears 43 times in argument lists. It is fixed in Python, only which does not matter. o When using Python 3.7 or above, it respects Pep 563 and avoids imports which are deferred to runtime. Task-number: PYSIDE-735 Change-Id: I3bcd5d9284b853fe955376bf35c7897e3698da2b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Add debug output for function modificationsFriedemann Kleint2018-11-243-10/+150
| | | | | | Task-number: PYSIDE-834 Change-Id: I2530b44f704ef96b784a77512f71777d9fd492bb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Split The Signature Module After The Project SplitChristian Tismer2018-11-2430-643/+1063
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PySide project has been split into three pieces, including Shiboken. This had far-reaching consequences for the signature project. Shiboken can be run together with PySide or alone, with tests or without. In every configuration, the signature module has to work correctly. During tests, the shiboken binary also hides the shiboken module, and we had to use extra efforts to always guarantee the accessibility of all signature modules. This commit is the preparation for typeerrors implemented with the signature module. It has been split off because the splitting is not directly related, besides these unawaited consequences. I re-added and corrected voidptr_test and simplified the calls. Remark.. We should rename shiboken to Shiboken in all imports. I also simplified initialization. After "from PySide2 import QtCore", now a simple access like "type.__signature__" triggers initialization. Further, I removed all traces of "signature_loader" and allowed loading everything from PySide2.support.signature, again. The loader is now needed internally, only. Also, moved the type patching into FinishSignatureInitialization to support modules with no classes at all. The "testbinding" problem was finally identified as a name clash when the same function is also a signal. A further investigation showed that there exists also a regular PySide method with that problem. The test was extended to all methods, and it maps now all these cases to "{name}.overload". Updated the included typing27.py from https://pypi.org/project/typing/ from version 3.6.2 to version 3.6.6 . Task-number: PYSIDE-749 Change-Id: Ie33b8c6b0df5640212f8991539088593a041a05c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Move inject-code snippets to separate filesCristian Maureira-Fredes2018-11-2247-3027/+3924
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When code must be modified or added to certain functions, we currently have two options: * Write a template and include it into the typesystem, * inject code directly at a certain place of the function entry. The problem with injecting raw code is that since it is an XML file, one need to escape protected symbols, like "<" and "&". Thanks to a couple of complementary commits, now we can place this code snippets on a separate file without triggering a whole module compiling process, since the typesystem itself will not be alterered. All the injected code from the typesystem was removed and placed into a single file per module inside a top-level directory called glue. Some small fixes were included mainly regarding styling of the code. Task-number: PYSIDE-834 Change-Id: I823e92d241a528d75d5940090008db9bf297f49e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Improve enum type operations implementationCristian Maureira-Fredes2018-11-204-85/+102
| | | | | | | | | | | | | | | | | | | | | | | The current implementation of the enum operations, wrongly assumes that the first element is always an enum. This patch add some logic to determinate the types we are dealing with, to allow operations like: 2 + QtCore.Qt.Key.Key_1 which were not accepted before. Float numbers are not accepted for enum operations and a test case was included. Some tests were adapted since they were wrongly implemented. Fixes: PYSIDE-830 Change-Id: I407dca2b7c39fc684dbdac19ad45d259403ebadd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Pyside2: Fix crash invoking QScxmlStateMachine::submitEvent(QScxmlEvent*)Friedemann Kleint2018-11-201-1/+7
| | | | | | | | | Specify C++ ownership for the event (as is done for QCoreApplication::postEvent() and similar). Fixes: PYSIDE-850 Change-Id: I8d34842823d80779716d407e4fa6268533c5d080 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Update string treatment for VoidPtrCristian Maureira-Fredes2018-11-201-0/+8
| | | | | | | Task-number: PYSIDE-852 Change-Id: If1ff8407c7f9449be278869e91104372fa86790f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add std::nullptr_t supportCristian Maureira-Fredes2018-11-195-1/+93
| | | | | | | | | | | | Shiboken did not have support for `nullptr_t` so the converter was failing when encountering a `nullptr`. A test case is included. Fixes: PYSIDE-854 Change-Id: If5aad245e7074ed791bfc7a42a4c6a56de441d5b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Update the apidoc cmake step to copy shiboken doc htmlsVenugopal Shivashankar2018-11-153-3/+12
| | | | | | | | | This way it is easier to publish the docs online as well as package it for offline use. Besides, updated the links to the sphinx projects so that the linking between them works. Change-Id: Id7494d5bc8adf95bfaaf25dedb58f3b07ac6dca4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Signature: Implement Nested Classes and Functions for ShibokenChristian Tismer2018-11-158-293/+447
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch again contains a complete overhaul of the signature module. The code was re-implemented to properly support nested classes. Also, the code was reduced by AutoDecRef and by adopting a concise C++ style. Note.. We will add a shiboken signature test and complete mapping.py after the split into three projects is done. The split changes a lot and is needed right now! Signatures were quite complete for PySide, but the support for Shiboken was under-developed. Since we are planning to generally enhance error messages by using the Signature module, we should be able to rely on them to always produce a signature. Therefore, a general overhaul was needed to resolve all cornes cases for Python 2 and 3. Nested classes are supported, as well as plain module functions. The usage of the typing module might improve over time, but the Signature implementation is now considered complete. The loader will respect now the path settings which might not be the package dir but the build dir. This is more consistens with COIN testing. Task-number: PYSIDE-795 Change-Id: I246449d4df895dadf2bcb4d997eaa13d78463d9b Reviewed-by: Simo Fält <simo.falt@qt.io>
* shiboken: Generate static_cast for constructor parameters with spaceFriedemann Kleint2018-11-141-2/+7
| | | | | | | | unsigned long(0) does not work, use static_cast<unsigned long>(0). Fixes: PYSIDE-846 Change-Id: If41baebdf0b1228b658408e4c300872d17143e6f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* License documentation: Fix file name of bufferproc headerFriedemann Kleint2018-11-141-1/+1
| | | | | | | | | | | A new version is now in use, causing: qtattributionsscannertorst.py:122: ".../sources/shiboken2/libshiboken/bufferprocs27.h" is not a file Change-Id: I14d9b9d8902ff7b3595b0e5b88d957a3847ecdae Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove createIndex method that uses PyObject*Cristian Maureira-Fredes2018-11-134-55/+13
| | | | | | | | | | | | | | | | We have a proper `void*` treatment, so the extra function does not seems to be necessary. The injected code used for the interalPointer method was also removed since is better to leave on shiboken hands the conversion between void* and python types. A couple of test were adapted since wrongly used ModelIndex with Python objects. Change-Id: I082637c7d1dd1bb0f50a3c453513e5d722f4b783 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add tutorials to the documentationCristian Maureira-Fredes2018-11-056-0/+497
| | | | | | | | Included basic tutorials related to Widgets, QML and UI files. Task-number: PYSIDE-841 Change-Id: Ia338f8cf1a64e4f09617fb3ac5a898d28e527dbd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Friedemann Kleint2018-11-012-7/+5
|\ | | | | | | Change-Id: I5a8f41a2236601b7c5466586dd1cfc92c1afc391
| * QIODevice bindings: Fix invalid reads in read() functionsFriedemann Kleint2018-10-312-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running test in debug mode on Windows, failures occurred: File "sources/pyside2/tests/QtCore/qfileread_test.py", line 41, in readData return super(FileChild2, self).readData(maxlen) UnicodeDecodeError 'utf-8' codec can't decode byte 0xcd in position 21: invalid continuation byte File "C:/dev/pyside/pyside-setup511d/sources/pyside2/tests/QtCore/qfile_test.py", line 57, in testBasic self.assertFalse(obj.getChar()[0]) UnicodeDecodeError 'utf-8' codec can't decode byte 0xcc in position 0: unexpected end of data This is caused by missing initializers and terminating \0 characters in the QByteArrays introduced by ca806b438e8a27dc4562ac806d189765e93e09e5, unearthed by MSVC helpfully filling unitinialized data with random values. Fix by using a QByteArray of size n + 1 filled with 0. Initialize the character variable in the fix_char* template. Task-number: PYSIDE-40 Change-Id: Ia604841a89f1b1b9564c16d2f23cd9f7c20f5628 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Revert "Terrible workaround fix for hanging tests on macOS 10.12"Alexandru Croitor2018-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Once the qtbase commit (22c1a46a03bc3347afc0e7462e19558283d0e1b7) gets integrated into the qt/qt5 repo for dev branch, we can revert the terrible workaround fix, because it won't be needed anymore. This reverts commit 5cd52cda24bf70bf99f4deec037039df0ab928f5. Task-number: PYSIDE-724 Change-Id: I627c7ec945b864a1c16ba6cd7288807591f70140 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | shiboken: Remove defunct code trying to merge namespacesFriedemann Kleint2018-10-303-15/+4
| | | | | | | | | | | | | | | | | | Remove the function _NamespaceModelItem::uniqueNamespaces() which created a QSet of_NamespaceModelItem *. Hashing by pointer values does not have any effect. Change-Id: I723024f0004aacecf4f06a1baa10678848d4a56b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | PySide2: Pass on the result from native event filtersFriedemann Kleint2018-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | Add missing conversion of the long *result variable. Amends f4a6d74852b0ba6711195a9c3fc9356e677a3409. Task-number: PYSIDE-790 Change-Id: I2db9ffd80b569f68b714b21e2adaa3e34949af83 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Friedemann Kleint2018-10-2914-26/+35
|\| | | | | | | Change-Id: I3bb491686968e81382c135ab737da259d9796f52
| * Fix Memory Leak Caused By Wrong Limited API DefaultChristian Tismer2018-10-2913-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a type has nullptr as tp_dealloc, there apply different defaults. Static types had object_dealloc as default, while new heaptypes created with type_new have subtype_dealloc as default. A problem was now that PyType_FromSpec also has subtype_dealloc as default. But that is wrong, because a type that was written with the static type approach is already written with object_dealloc in mind and takes somehow care about further issues with that type. When we now convert this type and suddenly use subtype_dealloc instead of object_dealloc, things get pretty wrong. Finding that out was pretty hard and took quite long to understand. The fix was then very easy and is the best proof: Replacing our former (wrong) solution of supplying an SbkDummyDealloc with a function object_dealloc works perfectly, and the leakage completely vanished. The documentation now is also corrected. Task-number: PYSIDE-832 Change-Id: Ifc20c28172eb5663cd5e60dac52e0a43acfb626c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Add qCompress/qUncompress bindingsCristian Maureira-Fredes2018-10-221-0/+4
| | | | | | | | | | | | Task-number: PYSIDE-838 Change-Id: I88a8c90b53757f05668782bc407e8529f6fbb3c6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | PySide2: Re-enable native event filtersFriedemann Kleint2018-10-266-10/+98
| | | | | | | | | | | | | | | | | | | | | | Add QAbstractNativeEventFilter. Re-add the native event filter functions on QWindow and QWidget, modified to return a tuple bool/long, using a modification from PySide. Task-number: PYSIDE-790 Change-Id: I86fef1a0c168e69fb3391cd882ea05190985384d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>