aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add codeeditor exampleCristian Maureira-Fredes2019-01-302-0/+193
| | | | | | | Based on Qt's Code Editor example Change-Id: I17ba0dfbafcda5a599cd2ef051e842cdd4b6e305 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-01-236-2/+386
|\ | | | | | | Change-Id: I61b563bce41b43dda2b03ea46a456228435bc294
| * Run generate_pyi After Generation of All BinariesChristian Tismer2019-01-221-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In COIN, there is a racing condition under Windows: Python opens as many modules as it can, while the build process is not yet done. This can lead to the situation that a module is loaded by Python before the Windows Manifest Tool has been run, and that creates a crash. We therefore wait when COIN is run, until all binaries have been created. That means that we are the last process, and the tool must have been already run. In non-COIN builds it is more convenient when in case of errors the generator crashes early. Task-number: PYSIDE-735 Change-Id: I060dbd54432778f14f74830596f28b4db83a0692 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Add debug_windows.py scriptAlexandru Croitor2019-01-221-0/+357
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This script can be used to find out why PySide2 modules fail to load with various DLL errors like: - Missing DLL - Missing symbol in DLL You can think of it as a Windows version of ldd / LD_DEBUG. Underneath it uses the cdb.exe command line debugger, and the gflags.exe tool, both installed with the latest Windows Kit. The aim is to ask users to run this script when they encounter PySide2 imports not working on Windows. The user should then provide the generated log file. Incindentally it can also be used for any Windows executables, not just Python. Consider adapting it to work on Linux and macOS as well (using LD_DEBUG and something similar on macOS). Change-Id: Ic7ef37ffd0565495e0774e4db3fc509090607af2 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Disable WebAssembly config from CISimo Fält2019-01-221-1/+1
| | | | | | | | | | | | | | Qt for Python is not supporting that configuration. Change-Id: I4821ca84c1706cc60d3d43d5f20efbbda10e9c07 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * coin_build/test_instructions.py: Remove environment variables impacting cmakeFriedemann Kleint2019-01-222-0/+10
| | | | | | | | | | | | | | Remove CC,CXX which might be set by some COIN setup scripts. Change-Id: I33d56dfeb54476edf591fc765a4a4c3c8fe746a6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-01-1610-46/+156
|\| | | | | | | Change-Id: I6b5aec5c5fc0261de26b14057e3533480e6771c4
| * setup.py: Fix running under non-UTF8 localeFriedemann Kleint2019-01-163-20/+2
| | | | | | | | | | | | | | | | | | | | Redirecting stderr to stdout causes an error when running under non-UTF8 locales. For the build scripts, it is also not desired to mix the output channels, so, remove the redirection. Change-Id: I6e3d05ede00537c3cc4c022780e8d0ed27bb0cad Fixes: PYSIDE-880 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Support help() using the Signature ModuleChristian Tismer2019-01-155-22/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature module will be used to generate automated documentation by using the function signatures as docstrings. This functionality should be low-hanging fruit. Actually, it was a bit tricky to get this working. The crucial point was to use PyType_Modified(). The function works fine on methods. Supporting types needs some more effort. It is not clear why the __signature__ attribute can be added, but the change to __doc__ is not recognized. May be related to the absence of Py_TPFLAGS_HAVE_VERSION_TAG ? This will be addressed another time. Task-number: PYSIDE-908 Change-Id: If8faa87927899f4c072d42b91eafd8f7658c6abc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Fix security warning in formatting error messageFriedemann Kleint2019-01-151-2/+2
| | | | | | | | | | | | | | cppgenerator.cpp:2698:107: warning: format not a string literal and no format arguments [-Wformat-security] Change-Id: I41d976749023bda142b680930f2d54d00687eb47 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Fix a crash when overriding ↵Friedemann Kleint2019-01-141-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractNativeEventFilter.QAbstractNativeEventFilter() long * result is nullptr for the custom message WM_USER + 1 internally used by Qt (cf QEventDispatcherWin32::processEvents()). Add a check for that. Amends 899b3cfed8e1c3513f8d3001c53b0bb0cc1af548. Task-number: PYSIDE-790 Change-Id: I4c55cfb17aa95d79f728f43a9030d1f1cbb1d024 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-01-1433-310/+465
|\| | | | | | | Change-Id: Id589406a8107c8e24942f072356e5e6f9e5b051b
| * shiboken: Reduce C-style casts in generated codeFriedemann Kleint2019-01-141-47/+70
| | | | | | | | | | Change-Id: I9539c1a4e24e915d5b356afafbd902266d493b5a Reviewed-by: Christian Tismer <tismer@stackless.com>
| * shiboken: Refactor formatting of the PyType_Slot array in writeClassDefinition()Friedemann Kleint2019-01-132-31/+55
| | | | | | | | | | | | | | | | | | | | Change the tp_func handling such that "" means nullptr and introduce a formatter class for the entries to use nullptr and change the C-style casts to reinterpret_cast. Change-Id: I36a1a218d003035f23ab9f8d31c7a993379e23c2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Improve check when a QFlag<Enum> is foundCristian Maureira-Fredes2019-01-111-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the case of the method `addAxis` in the QPolarChart class, the generated code evaluates first the inherited method: QChart::addAxis(QtCharts::QAbstractAxis*,QFlags<Qt::AlignmentFlag>) instead of the same class method: QPolarChart::addAxis(QtCharts::QAbstractAxis*,QtCharts::QPolarChart::PolarOrientation) The condition to check if an argument was a `QFlags<Qt::AlignmentFlag>`, was just `PyNumber_Check(...)`, which was too broad, and then any Enum would pass that condition. The change was to include an additional condition to check the type of the EnumType that was passed as argument. Change-Id: I2eebb6f05c097d170a6d61633698444f03f20b02 Fixes: PYSIDE-898 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * shiboken: Use more nullptr or {} in generated codeFriedemann Kleint2019-01-111-27/+32
| | | | | | | | | | Change-Id: I96e3bff8a48f0bd5ea98c33a22ff12c31b01357d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Replace C-style NULL by nullptrFriedemann Kleint2019-01-115-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace in comments, code and generated code. Rename variable NULL_VALUE to NULL_PTR and make extern for follow-up changes. Rewrite code using NULL in QString::arg() (resulting apparently from some misunderstanding that it requires a terminating nullptr) to use printf-formatting to fix a warning: format not a string literal and no format arguments [-Wformat-security]). Change-Id: I97c111cadc09192132308924136eb6ede7a6bf44 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Update READMEsCristian Maureira-Fredes2019-01-113-10/+10
| | | | | | | | | | | | | | | | | | | | | | A couple of details were fixed: * the --jobs option that is now --parallel, * don't mention shiboken on the PySide2 wheel, * add a shiboken wiki page link, * among others Change-Id: I6e1ae7375bd425c2e0357a03e976ea70c7b05e1d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix snippet typoCristian Maureira-Fredes2019-01-111-1/+1
| | | | | | | | | | Change-Id: Ic38aa8ba9a2470c97eb5cbd83b7d227322207db9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix wrong METADATA for generated wheelsCristian Maureira-Fredes2019-01-111-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the 5.12.0 release, we noticed that a couple of strings in the wheel METADATA were not properly formed. The first case was the type of the description content: 'text/markdown', got interpreted as a tuple ('text/markdown',), which was not recognize as a valid format. The second issue was the summary. It was a two-line string: ('Python bindings ... ', '....') which got wrongly parsed, and we ended up missing some title information, and even getting the parenthesis on the description. Change-Id: I2f3e8b23e3d9a39355e6eb30ab79f581bde33d30 Fixes: PYSIDE-874 Task-number: QTQAINFRA-2455 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Documentation: Add \nullptr macro definitionFriedemann Kleint2019-01-101-0/+2
| | | | | | | | | | | | | | Task-number: PYSIDE-903 Change-Id: I727b861b048c48bbeea51272e607c06dfb58c1df Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Update and fix the Slot documentationCristian Maureira-Fredes2019-01-101-15/+15
| | | | | | | | | | | | Task-number: PYSIDE-691 Change-Id: I5a6691554b64b808591e3ed000f01ca0211167ab Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Documentation: Replace nullptr by None in signaturesFriedemann Kleint2019-01-101-3/+7
| | | | | | | | | | | | Task-number: PYSIDE-903 Change-Id: I4dc2cce4741c87e08b8b3d0dc911c62d044ee054 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Produce TypeError Messages Using the Signature ModuleChristian Tismer2019-01-1012-128/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TypeError messages can now be produced, based upon the signature module. As a feature under test, we produce ValueErrors instead in certain cases. This will probably improve, later. We are currently investigating how much can be determined, automatically. Task-number: PYSIDE-795 Change-Id: Ie8a648beaf8a3bed388e3c01ba501bb36859722e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Avoid creation of empty build directories in install treeStefan Brüns2019-01-081-3/+3
| | | | | | | | | | | | | | | | Initial-patch-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Change-Id: Ia1f86a8c8926dda2072a10757928497067580dca Fixes: PYSIDE-882 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * [reg] Remove createIndex method that uses PyObject*Cristian Maureira-Fredes2019-01-087-15/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though we have support for Void*, having to import it as an additional class to be able to call a separate function, is adding too much complexity so something that should be easy to do, like creating an index for an itemmodel. The regression is a change that replaced the way of doing: QAbstractItemModel.createIndex(0, 0, PyObject*) to QAbstractItemModel.createIndex(0, 0, VoidPtr(PyObject*)) which is not really intuitive, and is generating other issues. Included modification in the registries too. Change-Id: Ie6112c6baeb4fc3b22fc78e7edeb66aa4a17c22b Fixes: PYSIDE-883 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * libpyside: Use helper function for accessing the meta object in quick type ↵Friedemann Kleint2019-01-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | registration Fix an oversight of bbd32e9e52bda460dd1cb75d128dd1165d1fd152. Task-number: PYSIDE-784 Change-Id: Ic48fbed24bc86a848accda46602fd3f5cb27d411 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-01-0716-56/+191
|\| | | | | | | Change-Id: I9e81ceadebc28364ec7fc1b33a3c2aef4bf5bde4
| * shiboken: Refactor code generating the assignment of cppSelfFriedemann Kleint2019-01-072-21/+31
| | | | | | | | | | | | | | | | | | The code was needlessly convoluted and generated ugly C-style casts for wrapper classes. Factor out a function to write the assignment. Change-Id: I2bc4b258f254d36a1a22f68336c285e64df0aca1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Fix a rare type hint racing conditionChristian Tismer2019-01-062-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building type hints during the PySide build, it can happen that the QtMultimedia module already exists, but the QtMultimediaWidgets module is not yet built. Since during the build also directories exist alongside with the not yet existing modules, it can happen that such a directory is picked up by Python 3, which supports namespace modules without __init__.py . This case was already handled by the mapping modules, but QtMultimediaWidgets was directly imported and not checked. Now the check code has been extracted from the mapping reloader, and there is no more unchecked module left. Task-number: PYSIDE-735 Change-Id: I1a1f53525417651005d0759e417082fe71b02773 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Pyside2: Add free functions from namespace QtQmlFriedemann Kleint2019-01-043-1/+9
| | | | | | | | | | | | Change-Id: Ib4a9e8be733a3c8012e19c509ed98f87aad7cb6d Fixes: PYSIDE-892 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Fix crash when mixing static overloads with instance methods in derived classesFriedemann Kleint2019-01-046-10/+26
| | | | | | | | | | | | | | | | | | | | Use METH_STATIC only when there are no instance methods in the same class. Unearthed by a clash of QPlainTextEdit::find() and static QWidget::find(WId). Change-Id: I891c678e004a0abc3937437b0cac26e8094853de Fixes: PYSIDE-886 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix crash related to multiple inheritanceFriedemann Kleint2019-01-035-18/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the <class>_PTR_CppToPython_<class> converter function (written by CppGenerator::writeConverterFunctions()), the generated code used typeid(*ptr).name() to retrieve the name to use for the SbkObjectTypes. This construct returns the name of the outermost class (for example, "QWidget" for a QWidget-type paint device returned by QPainter::device()), as opposed to "QPaintDevice *" returned by typeid(ptr).name(). This caused a crash with multiple inheritance since QWidget inherits QObject and QPaintDevice and the "QWidget" type was associated with the QPaintDevice pointer. To fix this: - Add API to libshiboken to obtain the SbkObjectType* by name and check for the presence of a special cast function (multiple inheritance). - Generate the code of <class>_PTR_CppToPython_<class> as follows: Check whether the outermost type obtained by typeid(*ptr).name() has a special cast function. If that is the case, use the type name obtained by typeid(ptr).name() (base class) to create the wrapper. Change-Id: I8ee6b4c084e9dafa434623433661809b83aedee5 Fixes: PYSIDE-868 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Make signatures in overload decisor code more verboseFriedemann Kleint2019-01-031-2/+9
| | | | | | | | | | | | | | | | Add 'static' and class name. Task-number: PYSIDE-886 Change-Id: Ie70d3b405e034f6203c54a363e3037c83720af00 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-01-0217-96/+98688
|\| | | | | | | Change-Id: If2d6bd614adb0a101ad55d08a510887d02db10cd
| * Update after Activate existence_test.py for 5.12Christian Tismer2018-12-274-0/+98441
| | | | | | | | | | | | | | | | After the existence test war activated, the newly generated files are ready for checkin. Change-Id: I5118b83fab1a1c52c56166aaf4e8b026722966e0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Doc: Reduce module list duplicationVenugopal Shivashankar2018-12-262-29/+0
| | | | | | | | | | | | | | | | This would avoid unnecessary maintenance work updating the modules list in several places. Change-Id: I13466ada3568c45391a7c35f287cc11c2ad218a5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Activate existence_test.py for 5.12Christian Tismer2018-12-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | There have been a lot of changes and enhancements when recursive classes were enabled and type hinting was created. When these patches are stable and checked in, this follow-up should be activated and all signature files re-created. Task-number: PYSIDE-735 Change-Id: I0c80c7986a5e02e380760d0a6b89faa7be2be2ba Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Complete The Signature IntrospectionChristian Tismer2018-12-228-61/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signature module has been quite far developed. In the course of making things fit for the TypeErrors with the signature module, now also all signatures from all shiboken modules are queried. Instead of writing an extra signature existence test for shiboken, it made more sense to extend the existing init_platform.py by the shiboken modules. In fact, by this query a corner case was exploited that worked on Python 2 but assertion-crashed on Python 3. The mapping.py modules were also completed to support all new PySide2 modules. Special care had to be taken because the "shiboken2" module exists both as directory and as binary module. The fix was tricky, and I will add a task that replaces such workarounds by a better design. Task-number: PYSIDE-510 Change-Id: Ibf8e322d1905976a0044a702ea178b7f98629fb4 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * PySide2: Add QWebEngineUrlScheme for 5.12Friedemann Kleint2018-12-212-0/+10
| | | | | | | | | | | | Change-Id: I72ae6d0af284dc85e9f36faafd9b9d3bf27c7962 Fixes: PYSIDE-878 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Refine .pyi MessagesChristian Tismer2018-12-171-5/+15
| | | | | | | | | | | | | | | | | | | | The generation of .pyi files talks too much when "--reuse-build" is used and actually no files are created at all. This patch guarantees that only one message comes out. Change-Id: I41f1aada0da27f0fab880ad51838f8615d61b08c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2018-12-14126-347/+131
|\| | | | | | | Change-Id: I34e9cc979da191aabe800f497ab6152b2e05dca2
| * Bump shiboken2 and pyside2 version numbers to 5.12.1Simo Fält2018-12-122-4/+2
| | | | | | | | | | Change-Id: Id54e27c36b7c6f6685013ae01d90ba4ae8e72457 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Doc: Add a link to the known issues wiki pageVenugopal Shivashankar2018-12-121-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | The wiki page describes some known issues and considerations that are useful to the developers. Also, moved toctree to the top to get readers' attention, as the modules list is too long. Change-Id: Id2dcce1fe51c2c9e9eacb45e573605cc21d3a59d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Change example scripts permissions to 644Cristian Maureira-Fredes2018-12-12117-117/+0
| | | | | | | | | | | | | | | | | | | | | | There was a mix of 644 and 755, since we expect the users to execute: python example.py we do not need to have files with 755. Change-Id: Iba9b2f5dbb57fe2a3503d8dfe971a4e92e764022 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simo Fält <simo.falt@qt.io>
| * syntaxhighlighter example: Fix upFriedemann Kleint2018-12-111-73/+47
| | | | | | | | | | | | | | | | | | | | | | - Use a QTextStream to read lines correctly. - Base it on QSyntaxHighlighter instead of hooking into the text document. - Streamline code and use standard keybindings - Fix imports. Change-Id: I2bd9571c85bb3cca1e90cd9cb441dfe35d26b685 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * shiboken: Make warning about non-existing templates fatalFriedemann Kleint2018-12-113-65/+14
| | | | | | | | | | | | | | | | It should abort as it will usually result in broken code. Change-Id: I81d930c4516b0ee97dec985525fab8140fdce3dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * generate_pyi.py: Add --quiet optionFriedemann Kleint2018-12-112-4/+11
| | | | | | | | | | | | Task-number: PYSIDE-735 Change-Id: I864270454bf4f7eee1a28b55ed06ffbf1c60d74d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Fix typo on templateCristian Maureira-Fredes2018-12-111-3/+1
| | | | | | | | | | | | | | Old template typo that was transformed into a snippet. Change-Id: I58dfcde3d7f0bf7b769d76b51fea659d98aac5ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix locking in generate_pyi.pyChristian Tismer2018-12-101-73/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file locking was written for Windows in mind. But file operations are quite different on Linux. This was no problem during normal builds, but showed up das a possible racing condition when using the "--reuse-build" flag. This version uses a directory to create a lock and has no platform specific code. Task-number: PYSIDE-735 Change-Id: I9f27839b0697b49b4dbfea26d6f6949ec466c9d5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>