aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* QApplication::setStyle ownership transferCristian Maureira-Fredes2018-11-281-0/+8
| | | | | | | | | | | | | | 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-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Split The Signature Module After The Project SplitChristian Tismer2018-11-246-20/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Improve enum type operations implementationCristian Maureira-Fredes2018-11-203-7/+23
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Add std::nullptr_t supportCristian Maureira-Fredes2018-11-192-0/+57
| | | | | | | | | | | | 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>
* Signature: Implement Nested Classes and Functions for ShibokenChristian Tismer2018-11-151-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove createIndex method that uses PyObject*Cristian Maureira-Fredes2018-11-132-14/+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>
* 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>
* PySide2: Re-enable native event filtersFriedemann Kleint2018-10-261-2/+21
| | | | | | | | | | | 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>
* Improve build rules for module generationAlexandru Croitor2018-10-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously whenever a typesystem XML file changed, this resulted in a full rebuild of all cpp files generated for that particular module. This change shifts the rules of building in such a way, that files are rebuilt only if their content has changed. XML modifications should generally not cause full rebuilds anymore, unless the change is in a global header. This is achieved in the following way, assuming a binding library "foo" added by add_library(foo ...): 1) CMake calls shiboken via add_custom_command. 2) The OUTPUT file for the command is the generated mjb_rejected_classes.log file, which serves as a timestamp for when shiboken was last run. 3) All the generated cpp files are marked as "Generated" via the add_custom_command BYPRODUCTS option. This allows the files to have an older timestamp than that of an XML file, thus not forcing constant shiboken re-execution. 4) A new custom target foo_generator is added via add_custom_target. 5) This target has a dependency on the mjb_rejected_classes.log file, and the target itself is added as a dependency to the "foo" target. 6) Whenever "foo" is built, it will first try to build "foo_generator" which will force the shiboken custom command to be run, which will generate the cpp files and mjb_rejected_classes.txt file. The BYPRODUCT cpp files can then be used as sources in the "foo" target. 7) If a user modifies the XML file listed in the add_custom_command DEPENDS option, this will re-trigger shiboken execution, which will create a new mjb_rejected_classes.log file, which means that the "foo" target might be rebuilt if, and only if, any of the cpp file timestamps are new. Otherwise "foo" doesn't need to be rebuilt. Change-Id: I9a3844a2fa775106288acc01cb4570a903e16991 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* libpyside: Port DynamicQMetaObject to QMetaObjectBuilderFriedemann Kleint2018-10-221-0/+6
| | | | | | | | | | | | | | | | | | | | Qt 5 introduces a new class QMetaObjectBuilder for generating dynamic meta objects for use cases like QML. It provides an API to add methods, properties and info and a factory method toMetaObject() to obtain a QMetaObject snapshot reflecting the changes. Replace the DynamicQMetaObject aggregated by TypeUserData by a class MetaObjectBuilder wrapping a QMetaObjectBuilder with dirty-handling. The code to create the binary data of the QMetaObject can then be removed. For plain Qt objects, the wrapped base meta object will be returned (which fixes the bug). Task-number: PYSIDE-784 Change-Id: Id8a54570aff36c75fe0f3bf2d297a12d02cd773a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Prepare the Signature Module For More ApplicationsChristian Tismer2018-10-111-86/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the preparation for a number of planned applications and extensions using the signature module. This general overhaul contains: - Extraction of signature enumerations into enum_sigs.py, - a list of current keyword errors in arguments which are unsolved in shiboken, but temporarily fixed in parser.py (too many for XML), - fix spurious duplications in multiple signatures - corrections for keyword errors in function names which cannot be fixed by Python (quite few), - fixing "..." arguments into "*args", - supporting the "slot wrapper" type. This is necessary for methods like "__add__", "__mul__" etc. - Create an extra function "get_signature" that has a parameter to modify the appearance, i.e. without self, without returntype, etc. Task-number: PYSIDE-510 Change-Id: If16f7bf02c6e7cbbdc970058bb630ea4db2b854a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Simplify and correct the new_inherited_functions testChristian Tismer2018-10-081-86/+67
| | | | | | | | | | | | | | | | | | | | | | The test was written when PySide2 did not have the "from PySide2 import *" feature. It was written with "try..except" constructs to find the translated modules. This did not work correctly due to the path settings in ctest. When not all modules are selected, they are still partially importable! For instance, PySide2.QtPrintSupport could be imported, although it was not compiled, and then complained since a function was not found. This is possible, because python 3 supports module directories without an __init__.py file. (I was always against that "feature".) Instead of adjusting the path setting, this patch uses the above feature and does not rely on "importability". Task-number: PYSIDE-331 Change-Id: I9aed4971f10f423918525cf411fd7ff713f40e48 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-09-213-0/+55868
|\ | | | | | | Change-Id: Ie4320a6ac584ec47ed8eaca538453a8e5b123c42
| * Update the Registry After Explicit Linux NamingChristian Tismer2018-09-133-0/+55868
| | | | | | | | | | | | | | | | | | | | | | Linux is now renamed in a way that the Linux distributions are recognized. The names are a _bit_ verbose, but this works, at least :-) Task-number: PYSIDE-510 Change-Id: Icd52cc92aa0e0b9c6e6b38e632cb89d09766c190 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | PySide2: Base the QMatrix<R>x<C> on QGenericMatrixFriedemann Kleint2018-09-141-1/+14
| | | | | | | | | | | | | | | | | | | | After fixing non-type templates, QGenericMatrix can be specified as their base class. The inherited functions can then be used instead adding templates. Change-Id: I5ec435cf04d8443626a86a78643e2ad5d29f4a5e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-09-133-2/+37691
|\| | | | | | | Change-Id: I7f60b78b0c962e4faf3688581e7f550813d1a413
| * Update the Signature Registry After ResetChristian Tismer2018-09-133-2/+37691
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New exists_{platf}_{version}_ci.py have created, after the registry was reset in the last commit. We had a problem with differences between Linux versions which led to incompatibilities. Therefore, the platform name has been changed for Linux: We now distinguish Linux platforms by name and version by using platform.linux_distribution([:2]). Example.. "Ubuntu 16.04" becomes 'ubuntu1604'. When this checkin succeeds, we will need another last checkin. Change-Id: I98511ee6fc3273055d1990a2cf4f2c028a430455 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-09-127-55775/+371
|\| | | | | | | Change-Id: Ie346fe7d7ac85ce0b82806904044680713375bf0
| * Automate Parsing COIN testresults for exists_{platf}_{version}_ci.pyChristian Tismer2018-09-101-0/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The extraction of exists_{platf}_{version}_ci.py has been done by editing the testresults of COIN test by hand. Since the beginning of the year, this has become tedious, because COIN now surrounds everything with time stamps. This script scans the whole website and extracts all such files. Creation of the generated python pages becomes really easy now. The initial scan takes below 30 minutes. Then it will only parse new URLs. Task-number: PYSIDE-510 Change-Id: I1273f8a77596ced16c7a3653c89736c3e1796540 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Reset the Signature Registry after the Total ScanChristian Tismer2018-09-106-55775/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After scanning the whole COIN test website, a lot of changes were found which we missed by manually inspectation. This update contains the essence of all changes which accumulated on the server. They were sorted by date, and the latest version was taken. Then, the license headers were updated, because that had been done already on the repository. Update ------ This check-in did not work on 2018-09-07. The reason was that we changed the PySide version to 5.11.2, which was not yet in my update. While re-doing the generation, I realized that we will not automatically get the 5.11.2 version, because of the "fallback". feature. To reset the existence file, we need to remove them once. After the checkin, all the files will be freshly created. I propose also to disable the "fallback" feature. In the presence of the multiple COIN testing, it is no more necessary. Change-Id: I43af314f7bd233a4190762c7204e8aecf81bfe72 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | pysidetest: Remove old cmake policyFriedemann Kleint2018-09-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix warning: CMake Deprecation Warning at tests/pysidetest/CMakeLists.txt:7 (cmake_policy): The OLD behavior for policy CMP0020 will be removed from a future version of CMake. cmake should be smart enough to figure CMP0020 (automatic linking of qtmain.lib on Windows) out by itself. Change-Id: I3f0fb53158217be87b2c7971d84b19359998970c Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add bindings for 5.12Friedemann Kleint2018-09-104-0/+121
| | | | | | | | | | | | | | Task-number: PYSIDE-487 Change-Id: Ib37efc4e480a978f920d3bc40756fe7abd59cb19 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | shiboken: Add support for const Foo* fieldsFriedemann Kleint2018-08-291-0/+2
| | | | | | | | | | | | | | | | Task-number: PYSIDE-304 Task-number: PYSIDE-672 Change-Id: Ic0e8e9ada594f27a8224adfb43847b3b8149c33d 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 devFriedemann Kleint2018-08-293-89/+5
|\| | | | | | | Change-Id: I302543eef74bc1f3dc6340cdfab7510a66ea1b6a
| * Reduce the redundant signature_testChristian Tismer2018-08-273-89/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file signature_test.py contained together with basic signature property tests also an early form of the existence test, which is meanwhile implemented in pyside2/tests/registry/existence_test.py . This part is redundant in signature_test.py, and we remove it. The basic signature tests stay, and the module is degraded from registry to a normal test module in pyside2/tests/QtWidgets . Remark: This simplification was found when I was finishing the signature documentation. Instead of describing the intermediate state of the module, it was more straight-forward to remove the duplication. Task-number: PYSIDE-510 Change-Id: I7fbf65d6d2803926dc00485f1e82349912742942 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-08-242-0/+122
|\| | | | | | | Change-Id: Ide71a89ef173d6f3e1fa6960f7b15f1fd6cc1bf1
| * Implement Proper Name ManglingChristian Tismer2018-08-212-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When types have attributes starting with two underscores but ending with at most one, Python uses name mangling to create a unique private variable. PySide needs to obey this rule in the tp_getattro methods. We implemented it as an optimized _Pep_PrivateMangle function that solves the problem internally without exposing the _Py_Mangle function. Remark: I think the exclusion of the _Py_Mangle function is another oversight in the Limited API. Task-number: PYSIDE-772 Change-Id: I0bfc2418dae439e963a16e37443f2099c6980696 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-07-064-8/+179
|\| | | | | | | Change-Id: I52be54b4bd400df557255b7d88eb22cb7260ca31
| * Remove Py_TPFLAGS_HAVE_VERSION_TAG in Python 3Boxiang Sun2018-07-052-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | The Py_TPFLAGS_DEFAULT in Python 3 has the Py_TPFLAGS_HAVE_VERSION_TAG flag, which causes the type attribute cache in _PyType_Lookup. According to the Shiboken implementation for Python 2, this is not we expected. So remove the Py_TPFLAGS_HAVE_VERSION_TAG flag from Py_TPFLAGS_DEFAULT in Python 3. Task-number: PYSIDE-60 Change-Id: Id731a59b65640eb5adea56fe06e0deb58ac4a168 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Add test case for QVariant/PySequence issueCristian Maureira-Fredes2018-07-041-8/+34
| | | | | | | | | | | | | | | | | | | | Simple test to see if the current implementation is working in all the platforms Task-number: PYSIDE-641 Change-Id: I85f19979b84314d42deb6686f2cdb29ba6af079c Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Add test for "Segfault when emitting string with emoji"Christian Tismer2018-07-042-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | The used constant was encoded directly as a unicode literal. This was the same possible in Python 2 and 3 due to https://www.python.org/dev/peps/pep-0414/ . Note that the emoji character creates a 1 or 2 codepoints long constant because Python 2 can be built with UCS-4 or UCS-2. Task-number: PYSIDE-336 Change-Id: Icc7ea664cf64f9e53ef5f7696c56c6470f7ada4a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Terrible workaround fix for hanging tests on macOS 10.12Alexandru Croitor2018-07-031-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with Qt 5.12-ish (qtbase commit c538a333db4b7526fb4d9a82c06296d2492bf000) the macOS QPA cocoa plugin switched to using layer-backed NSViews. For some unknown reason when building PySide2 with a python.org official interpreter and the above commit, none of the QWidget / NSViews get drawn (-[QNSView drawRect:] is not called). Using an older qtbase with the same official interepreter works. Using the same qtbase with a custom built interpreter works. Using the same qtbase with a custom built interpreter which is the same version as the official one (3.6.5 at the moment) works (built from v3.6.5 source package published on the downloads page). Using the same qtbase with official interpeter does NOT work. Python2 vs Python3 does not matter. Release vs Debug does not matter. I have not been able to build an interpreter with the minimum deployment target set to 10.6 as the official package does (but rather 10.12), so this is still an avenue to try. The terrible workaround is to disable layer-backed views via an environment variable when running testrunner (QT_MAC_WANTS_LAYER). All users would have to do the same for their own applications, otherwise they will not work. Change-Id: Ia9a34f1e7b0b1b4807030cc7acecbefc8f344e84 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Implement proper slice assignment for QByteArrayBoxiang Sun2018-07-021-40/+85
| | | | | | | | | | | | | | | | | | | Index assignment now only accept str/bytes, bytearray, QByteArray with size 1; Slice assignment only accept str/bytes, bytearray, QByteArray with limitation, that is if the step is not 1, then the number slots and the size of the target value must be equal. Range delete: a[2:5] = None Shrink: value length smaller than the slot length of the slice Expanse: value length bigger than the slot length of the slice Range assignment with step: a[2:5:1] = ... Range assignment with step which bigger than 1: a[2:9:2] = ... Range assignment with native step: a[5:2:-1] Change-Id: Ib9b929d09a691ed18c91e0c1c6b5dde827bf8d42 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Create registry files for 5.11Christian Tismer2018-06-293-0/+55760
| | | | | | | | | Update of the signature registry files for 5.11 . This works now in a single go, because the missing files are generated as a flaky test. Change-Id: I455eba83ae8b81ce97d5d7bcc41e7ff98c5be8bd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* existence_test.py: Make multi signature mismatch message more verboseFriedemann Kleint2018-06-261-2/+12
| | | | | | | | | It now looks like: multi-signature count mismatch for 'QOpenGLShaderProgram.setAttributeArray'. Actual 10 [ (int,PySide2.QtGui.QVector2D,int) (int,PySide2.QtGui.QVector3D,int) (int,PySide2.QtGui.QVector4D,int) (int,float,int,int) (int,int,int,int,int) (str,PySide2.QtGui.QVector2D,int) (str,PySide2.QtGui.QVector3D,int) (str,PySide2.QtGui.QVector4D,int) (str,float,int,int) (str,int,int,int,int)] vs. expected 4 [ (int,float,int,int) (int,int,int,int,int) (str,float,int,int) (str,int,int,int,int)]') Change-Id: I6c99e1fceeeb1647c8b3b291564190b9a2c0dd32 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix index() method of QAbstractItemModel-derived classesFriedemann Kleint2018-06-251-0/+2
| | | | | | | | | Prepend virtual methods when creating function groups so that overriding method the most-derived class is seen first. Task-number: PYSIDE-570 Change-Id: I791e3da09783c4c31ac293060aed8bb2bc8472d5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix QtQml/bug_814.pyCristian Maureira-Fredes2018-06-221-1/+1
| | | | | | | | | | Since roleNames() expects a QByteArray we should pass the roleName as bytes, not a Python string. Task-number: PYSIDE-722 Change-Id: I67bf78503cd1e6acf43aab3531bf3b184e9a9159 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Allow building just QtCore bindingsAlexandru Croitor2018-06-221-1/+3
| | | | | | | | | | | | | | | | | | | This change introduces tracking of modules for which bindings will not be built. This allows us to add conditions on disabled modules, and thus disable certain tests. Thus we disable pysidetest test when its dependencies are not met. Due to this, we can now builtd bindings only for QtCore, allowing faster development iteration when touching only QtCore. Note that this only affects which module bindings will be created. Shiboken itself still requires QtCore, QtXml and QtXmlPatterns, as does pyside2-rcc. Change-Id: I75084a1741e7f4c3594e43af0fd9668a0e969c56 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix failing versioninfo_test when the version is not a pre-release oneAlexandru Croitor2018-06-081-1/+1
| | | | | | | | | | | | The test used to fail when pre-release version parts are empty (aka there is no "beta1" or "alpha2"). Make sure to always include at least an empty string when those version parts are not set, and adjust the test accordintly to check for a string. Change-Id: Ia30bb99de7f122456e132516346df4e3c0a1fa94 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge branch '5.9' into 5.11Alexandru Croitor2018-06-082-1/+75
|\ | | | | | | Change-Id: I7e55b4f27f77e2333b9e0f4cddc8de4b89b6043b
| * Add bindings for QtWebEngine (aka Quick)Alexandru Croitor2018-06-072-1/+75
| | | | | | | | | | | | | | | | | | | | | | There is only one method we really need, QtWebEngine::initialize() which is used for all Qt Quick based WebEngine applications. Otherwise you get a warning upon startup of a Qt Quick WebEngine application, and this might lead to undefined behavior. Task-number: PYSIDE-688 Change-Id: I7de2bbb58c49cb2a41b0e13ffc9de6a3161f3960 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge branch '5.9' into 5.11Alexandru Croitor2018-06-0731-150/+215
|\| | | | | | | Change-Id: I2de0fe8456fca242c56ea28520126f9ebbf540d8
| * Fix glitch in voidptr.cpp after the PEP 384 commitChristian Tismer2018-06-052-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By lots of editing, somehow an expression in voidptr.cpp became incomplete. We should improve the current test to be certain that the VoidPtr is working. This problem can be avoided by not doing many type casts at once. Doing the same in two steps is much safer because a forgotten call would give a compile time error. Task-number: PYSIDE-560 Change-Id: Ibb24a27f439cbda490723131f34f93978725420f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Improve the QByteArray implementationBoxiang Sun2018-06-0129-154/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Improve sbkstring::toCString to support unicodeBoxiang Sun2018-06-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | If `unicode` is used in Python 2, shiboken cannot properly translate it to `const char *`. sbkstring did not supported a proper conversion of unicode types in Python2, and this change includes it. Task-number: PYSIDE-100 Change-Id: I3a70d935ad61b0e567e620c62754800370270a6b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.11Friedemann Kleint2018-06-011-4/+4
|\| | | | | | | Change-Id: I31a0ff26bc02e6cc2ec2a816c16d170fc334f800
| * Fix test to assert only if english is the localeCristian Maureira-Fredes2018-06-011-4/+4
| | | | | | | | | | | | Change-Id: I3188c33414d283478a6ff6d7d354ce9231b4f106 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.11Friedemann Kleint2018-05-263-0/+143
|\| | | | | | | Change-Id: I0c5b60263ed642a9b6f6b5d6a1492a11f278bfd5