aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* cmake: Fix warning about missing scope for --quietFriedemann Kleint2020-02-191-1/+1
| | | | | | | | | Remove scope, fixing: Cannot set "CMAKE_INSTALL_MESSAGE": current scope has no parent. CMake Error at data/shiboken_helpers.cmake:218 (_message): Change-Id: I7499eef3af499e1d02b548b19fca3dda7647b16e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Sign windows binariesSimo Fält2020-02-191-1/+25
| | | | | | | | | | | To be able to sign windows binaries we need to split the setup call to two phases. First we build all binaries, then we call Qt CI's function to do the signing and finally we create the wheels. Task-number: PYSIDE-858 Change-Id: I759a5aa7284736cbac0883ee5fd017345168c8b4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Cleanup build and test instructions callsSimo Fält2020-02-192-233/+29
| | | | | | | | There is no need to specify seprate call for each target/host arch combination. Change-Id: I02afadace9bfb561476825182bff883b5f79bfa8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Split module config instructionsSimo Fält2020-02-197-489/+516
| | | | | Change-Id: Ia0b47d0e264f00d859e20e18980b7899dddaba98 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Handle typedef'ed enumsFriedemann Kleint2020-02-182-9/+28
| | | | | | | | | | | Treat "typedef enum {} Name" as "enum Name". Clang actually provides type information for these cases, use it (taking care not to break real anonynous enumerations) and skip the repetitive definition of the elaborated type. Fixes: PYSIDE-1228 Change-Id: Icaf0450f3fea3ba9f06737e351b56e6e5df0749a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Improve the libdir for windowsCristián Maureira-Fredes2020-02-183-3/+17
| | | | | | | | | | | | | | | | | | With virtualenv 20 we have the case where the first path in the PYTHON_LIBRARIES cmake variable was wrong: a_virtual_env/libs/python3.lib so the python code inside the helper didn't have a proper check if the file was valid or it was just a wrong construct. Additionally, the 'prefix' variable will contain the virtual environment directory location, which will not contain the 'libs' directory, because that's included in the system's installation path. To solve this, we use the 'INCLUDEPY' directory, which is correct as a base to create the real 'libs' one. Task-number: PYSIDE-1231 Change-Id: Ifca08d74c49cd57572836a087edb96c089266dc7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Bump versions stringsSimo Fält2020-02-122-2/+2
| | | | | Change-Id: I4ed952681abe6f42ff43a567f70fdc7e6512ddcc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix running the shiboken tests for Python 3.8/WindowsFriedemann Kleint2020-02-12143-32/+919
| | | | | | | | | | | | | | | | | | | On Windows, DLL directories can no longer be specified via the PATH environment variable. They need to be added via os.add_dll_directory(). In order to fix this, move the entire environment setup from CMake to a python helper and set a single environment variable BUILD_DIR pointing to the build directory from CMake. In addition, this has a huge advantage: The tests can also be executed much more easily without ctest from the command line by just setting BUILD_DIR instead of a complex manipulation of PATH/LD_LIBRARY_PATH. Change-Id: I7dceafd2c38fed5320a534322f265489657b95d3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Polish qp5_tool.pyFriedemann Kleint2020-02-121-52/+166
| | | | | | | | | | | | | Fix coding style warnings and bring it up to par with the qt6_tool in the works: - Add edit config file option - Add dry run option. - Add support for Incredibuild - Log build time - Print help if no option is given Change-Id: Ia8ec5f0d4d9e9c127172fb22f3efea11ce1ab6ff Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the webchannel standalone exampleFriedemann Kleint2020-02-119-0/+575
| | | | | | | Task-number: PYSIDE-1199 Change-Id: Icc138844b0cb5e7ccb502cbe840fc578fad8ca8f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Refactor writing of get/setattro methodsFriedemann Kleint2020-02-104-137/+173
| | | | | | | | | | | | | | | | | | | | | | getattro functions are needed for: - smartpointer dispatch - special cases of function overload resolution setattro functions are needed for: - smartpointer dispatch - QObject property handling All of this was previously handled in the writeSet/GetattroFunction which duplicated, inconsistent checks in various places, which makes it very hard to add additional functionality to tp_getsetattro(). To overcome this, define a flag to describe the various use cases, a check function to determine it. The flag is passed to the write functions. Smart pointer handling is split out completely since it will never mix with the other use cases. Task-number: PYSIDE-803 Change-Id: Iead9ee5b086830fb670b25917914117da62fefe5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Add explanatory comment to getattro functionFriedemann Kleint2020-02-101-0/+2
| | | | | | | | | Make it clear how the dispatch works. Task-number: PYSIDE-454 Change-Id: Idd98eee5a7f7d45891c8a7dd0170f9188f136296 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 0ffb486e27996bbd81cde5f3d73b2d8346386ffb)
* shiboken: Refactor the generated getattro()-methodFriedemann Kleint2020-02-101-75/+57
| | | | | | | | | | Remove else after return and simplify accordingly. Replace the check for self by an assert. Change-Id: I219e4887f0a699c21f718563ac696baf4c7f9d73 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit fd5768da8cc90faaa5a96c1c028db62915c18b0f) Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Fix usage of Qt's endl, preparing for Qt 6Friedemann Kleint2020-02-105-858/+844
| | | | | | | | | | | Cherry-pick the part of 870b7f4c849ebbc5f39f1f2398e39a3b7dfd9562 from 5.15 that joins "bla" << endl into "bla\n" to reduce further merge conflicts between 5.14 and 5.15 while preserving the ability of 5.14 to compile against Qt 5.12. Change-Id: Id9632973b253557c99b2f4e0a84c3db12c55f5b4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 870b7f4c849ebbc5f39f1f2398e39a3b7dfd9562)
* Fix testrunner for Python 3.8/LinuxFriedemann Kleint2020-02-071-4/+18
| | | | | | | | | | | | | | | | | | | When running tests with Python 3.8/Linux, the existence_test fails: File "pyside-setup/sources/pyside2/tests/registry/existence_test.py", line 73 from init_platform import enum_all, generate_all File "pyside-setup/sources/pyside2/tests/registry/init_platform.py", line 59 from util import get_refpath, get_script_dir File "pyside-setup/sources/pyside2/tests/registry/util.py", line 113 platform_name = "".join(distro.linux_distribution()[:2]).lower() AttributeError module 'platform' has no attribute 'linux_distribution' since platform.linux_distribution() was removed in 3.8. Extract into a separate method and warn to install distro. Task-number: PYSIDE-939 Change-Id: I42d04830d51563cc3fbaddc3941c927402514480 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix build on Windows using Python 3.8Friedemann Kleint2020-02-061-10/+37
| | | | | | | | | | | | | | The DLL load behavior was changed in Python 3.8 to no longer search the PATH variable for DLL dependencies. This means that the shiboken2.dll from the shiboken2 package is no longer found. Add the shiboken2 package using os.add_dll_directory() to fix this. Unfortunately, this requires additional work during the build process, Qt and libpyside2.dll need to be found in the build directory. Change-Id: I3d78d8df2d6f64913e06fa44e7e1aadbc1a14b58 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Create best-matching wrapper for unknown classes inheriting QObjectFriedemann Kleint2020-02-061-2/+19
| | | | | | | | Walk up the MetaObject hierarchy until a matching type is found. Fixes: PYSIDE-1214 Change-Id: I474edbfc710375951987e43469b7e7ea4366ab0c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Partial revert "Use qt5 5.14.1 in CI"Simo Fält2020-02-062-3/+3
| | | | | | | | | | This reverts commit 422546c884b9115cc2f1ba35bca36cc09a0a71ec. 5.14 should follow default Qt5 branch again, but we still want to update the PyInstaller to 3.6. Change-Id: I801d1a40192b2ee2873ca04710c788879a35532d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QList/QTable/QTreeWidget: Fix ownership of return valueFriedemann Kleint2020-02-051-0/+18
| | | | | | | | Specify C++ ownership. Fixes: PYSIDE-1189 Change-Id: I093e2af048aaabf00d124af66dcd3efc7c709e95 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix PyBuffer interface for QByteArrayCristián Maureira-Fredes2020-02-052-1/+15
| | | | | | | | | | | | | For the limited API, properly implement the PyBUF_ND flag (shape requested). Otherwise, use the convenience function PyBuffer_FillInfo() to properly populate the view. Fixes: PYSIDE-1204 Change-Id: I2a4c81885cf49b25c89823577c0d7ee2f2707b87 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: replace wrong license headerCristián Maureira-Fredes2020-01-306-158/+165
| | | | | | | | By mistake some examples were released under LGPL, but Qt for Python examples are distributed with the BSD license. Change-Id: Idbbf2067f2321d14cb3276ea36fe13f6551498a6 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Prospective fix for flaky smart_pointer_test.pyFriedemann Kleint2020-01-302-3/+8
| | | | | | | | | | | | | | | | | | | | The test has been observed to fail apparently since the result was not collected. Traceback (most recent call last) File "sources/shiboken2/tests/smartbinding/smart_pointer_test.py", line 82, in testObjSmartPointer self.assertEqual(integerCount(), 1) AssertionError 2 != 1 File "sources/shiboken2/tests/smartbinding/smart_pointer_test.py", line 154, in testSmartPointersWithNamespace self.assertEqual(integerCount(), 2) AssertionError 3 != 2 Enforce a garbage collection to ensure the object is deleted. Task-number: PYSIDE-454 Change-Id: I85baa059319a5286f94a5607c4de32bfc50ae0e0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix Python 3.8 warnings about deprecated int conversions of enums/flagsFriedemann Kleint2020-01-292-1/+8
| | | | | | | | | | | | Set Py_nb_index to the conversion method for flags and enums. Fixes warnings like: examples/widgets/widgets/tetrix.py:107: DeprecationWarning: an integer is required (got type PySide2.QtCore.Qt.AlignmentFlag). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python. Task-number: PYSIDE-168 Task-number: PYSIDE-939 Change-Id: Id41a72474192b357afd3dacd0a2e2fc5e055775c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix grammar in considerations.rstChristian Tismer2020-01-291-2/+2
| | | | | Change-Id: I7d840367d9a733d925bbfeb78a0ba0c9c076e6c0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Let qApp be noApp instead of pretending to be NoneChristian Tismer2020-01-297-100/+64
| | | | | | | | | | | | | | | | | | | | qApp should stay almost as it is with only two cosmetic changes: When qApp's return value has Type(Py_None), the value now reports "noApp" instead of "None". Also the feature of "del __builtins__.qApp" is replaced by function qApp.shutdown() . This makes things easier to explain and avoids refcounting hacks. The embedding problem (Falkon browser) was too complicated. We finally solved it by disabling qApp in embedded mode. Change-Id: I0d99661137130684823aa3d1978b494d8ab08e59 Fixes: PYSIDE-1158 Fixes: PYSIDE-1178 Fixes: PYSIDE-1135 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add 5.14.1 changelog, addendumChristian Tismer2020-01-281-0/+1
| | | | | Change-Id: I70df7a265fd98ee9527909fc2e4e7bd1caacac98 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add 5.14.1 changelogCristián Maureira-Fredes2020-01-281-0/+34
| | | | | Change-Id: I74dd1dd6fbf1ad89c0d8e51dbaa0c19dcf55755b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* docs: QML and SQL integration tutorialMariana Meireles2020-01-276-0/+598
| | | | | Change-Id: I6ba4ae9fe6a9bfe669b76a23f27556b1f3c59eb4 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Add example for Threads and SignalsAlejandro Gutierrez2020-01-271-0/+98
| | | | | | | | | The goal of this file is to provide an example for signals being emitted from one thread to another. Task-number: PYSIDE-841 Change-Id: If494fbfef6d8c46b37d5b750163c909bc6c55c7a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: improve the star delegate exampleSamuel Gaist2020-01-272-3/+4
| | | | | | | | | | | | | While the example works correctly as is, if one takes the StarEditor class alone, it will fail to work as it uses a starRating attribute that is available in the example only because of the call to setEditorData by the StarDelegate class. This patch fixes that as well makes use of the append overload of QPolygonF taking a list of point to simplify the code a bit. Change-Id: Id8132fa86f5668645f48c62377dac65f707c968b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* docs: More fixes on deployment and faqKavindra Palaraja2020-01-274-62/+86
| | | | | Change-Id: I97d7251b0d9ec024ce069f6475d7bc6be0d9d362 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* docs: Improve Shiboken docsKavindra Palaraja2020-01-272-37/+34
| | | | | Change-Id: Ibcefb190f5ea50b7c8575cd03b9e0f69b3a170b6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Set default signal name only if previously assignedCristián Maureira-Fredes2020-01-271-1/+2
| | | | | | | | | | Just before registering the signal to the meta-object, the signalName was overwritten instead of checking if it had some content. Fixes: PYSIDE-1192 Change-Id: I5fc85bf22ae08bce6969b9381662288a99aee616 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* designer: patch rpath for unixCristián Maureira-Fredes2020-01-272-2/+20
| | | | | | | | | Designer is not statically compiled, so we need to add a RUNPATH to use the Qt libraries we ship with the wheel. Change-Id: I715fcd852b63da99104198be2a4587b042a1eab7 Fixes: PYSIDE-1165 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update pyside2-toolsCristián Maureira-Fredes2020-01-271-0/+0
| | | | | Change-Id: I364ab18fede462ac9e6b5a318a29e5244e2f9156 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix machinery and pep425tags CI errorCristián Maureira-Fredes2020-01-272-3/+12
| | | | | | | | | | | | | | | Currently the Shiboken macro only handles AttributeError but when 'machinery' is not found inside 'importlib' that case also needs to be handle by the except clause. Adding ImportError will allow us to get access to the Python suffixes that we need to build. Additionally, some old versions of Python (2.7.14) require an "archive_root" parameter on the 'wheel.pep425tags.get_supported' function, which is not required in new versions (2.7.16, and 3+). Change-Id: Icc6e7d1e9384ea01eec9281586f7ca988e3eb649 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix ownership of QTextDocument::createObjectCristián Maureira-Fredes2020-01-241-1/+2
| | | | | | | | | | Since it's a virtual method, we need to specify that the native counterpart of the method will live in C++, and in the target scope it will live in Python. Fixes: PYSIDE-1207 Change-Id: I5b9072380eed17270affa39c5976dc6b1fe293ff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* docs: Fix pre overlap and improve readingCristián Maureira-Fredes2020-01-242-4/+2
| | | | | | | | | | | | | Removed the color and the padding on the 'pre' elements of the docs. Additionally increased the line-height globally to 1.4 to make the reading easy. Fixes: PYSIDE-1201 Change-Id: I292d4e6da616ecb84a923444b99ad28a28d6cc5d Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* libpyside: avoid freeing char*Cristián Maureira-Fredes2020-01-241-4/+2
| | | | | | | | | | The doc parameter was being freed causing a segmentation fault, according to the implementation of the parse function, it's not necessary to free. Fixes: PYSIDE-1205 Change-Id: I5850e7feaf354b27cc4496dc83be214d1729a048 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Introduce "until" version attribute as opposite of "since"Friedemann Kleint2020-01-246-29/+69
| | | | | | | | | | Prototypically use it for QMessageLogContext, allowing to elegantly build for Qt from version 5.12..now using a single type system file. Fixes: PYSIDE-1191 Change-Id: Iaa7bdc10c7129d84c54e85a09a1c802a409708f9 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix printer test in returnquadruplesofnumbers_test.py on some systemsFriedemann Kleint2020-01-241-0/+2
| | | | | | | | Setting the page margin used for comparing tuples requires a PDF printer. Ensure PDF format if no such printer can be found. Change-Id: Ie8509d4a336392cb711e210842664e238c487444 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* xmlpatterns / schema example: Fix build warningFriedemann Kleint2020-01-241-1/+1
| | | | | | | | Compare integers using ==, fixing: schema.py:203: SyntaxWarning: "is" with a literal. Did you mean "=="?( Change-Id: Id94c454d4695bc3b0f89bf6b5301066d722b5e33 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* build_scripts: Fix resource warning in Windows debug buildsFriedemann Kleint2020-01-241-0/+1
| | | | | | | | | Close the pipe obtained by POpen, fixing: build_scripts\main.py:1185: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 encoding='cp1252'> out = run_process_output(cmake_cmd) Change-Id: I5de0391003b40119758d93712d8178694e7fc14b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide2/__init__.py: Print import errors verboselyFriedemann Kleint2020-01-241-1/+11
| | | | | Change-Id: I9cac73af695ecb123bc0e0b6ce35a10ee1026ea2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use qt5 5.14.1 in CISimo Fält2020-01-242-2/+4
| | | | | | | | | Qt5 5.14 is currently broken from Qt For Python point of view, so we should verify Qt For Python against 5.14.1. This patch should be reverted once Qt branches are fixed. Change-Id: I8a0249284665381decc42f94faab6d8e9650f8bb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: remove unused importsCristián Maureira-Fredes2020-01-0648-92/+62
| | | | | Change-Id: I85216bcfc23161b832ecb675ea58f33e67004fe9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: remove semi-colons from filesCristián Maureira-Fredes2020-01-0614-99/+99
| | | | | | Change-Id: Iba52405551440659d60b11b3dfb9078d6066cec6 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix Limited API for Python 3.8Christian Tismer2020-01-061-1/+1
| | | | | | | | | | | | | | | | | | | This trivial patch fixes an omission that has not been caught in earlier versions: PyObject_INIT must be replaced by PyObject_Init I think this change came by chance and was not the primary intent of the authors. Otherwise they would have made sure that the PyObject_INIT macro does not even exist when the Limited API is enabled. Change-Id: Iee8127dd398f1ec0997b9a629c5c48076137cecf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Shiboken: QtDoc: Change the order of entries at the beginningVenugopal Shivashankar2020-01-051-2/+2
| | | | | | | | | | | | In the class reference RSTs, the label entry must appear at first before the current module entry. In addition, there must be at least two empty lines before the page title. Otherwise, the module's index page drops out of the toctree, resulting in incomplete navigation breadcrumb. Change-Id: I65a35b0bb9f2946fb5d45b1d1b8a453c20745e79 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Update toctree to include only the module indexVenugopal Shivashankar2020-01-051-1/+1
| | | | | | | | | | The index adds all the class reference docs to the toctree so we don't need to include everything under the module directory. Change-Id: I6ef20914a63a1f246b06b2725435a4fc42deaf9b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>