aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* pathlib: migrate tools away from os.pathCristiƔn Maureira-Fredes2022-10-143-12/+12
| | | | | | Task-number: PYSIDE-2080 Change-Id: Id4a16e314df0f47e1a74001a23c825dbfa2956a7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* snippets_translate: Remove qAsConst(), std::as_const() from for loopsFriedemann Kleint2022-10-132-2/+5
| | | | | | | Pick-to: 6.2 Change-Id: If31883998a08073ecf4ca7bfb91ee000cc2f630f Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Documentation: Fix modules being omitted from the documentationFriedemann Kleint2022-10-121-4/+90
| | | | | | | | | | | | | | | | | | | 327350779203bdde7728a87e513e7e27dfc8e876 introduced a script tools/doc_modules.py that outputs all modules in the correct dependency order to prevent dependent typesystems to be loaded with generate="no". The generated order unfortunately clashed with the special casing in sources/pyside6/doc/CMakeLists.txt for modules with qdocconf files containing several modules. To fix this, move writing of required files (global header, global type system and global qdocfong) to the script tools/doc_modules.py. Only the configure steps for the qdocconf files are done in CMake. Pick-to: 6.4 6.4.0 Task-number: PYSIDE-1106 Change-Id: Ibd6d03e6622a220236298ccd59f03c6612cc908c Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* example_gallery: Switch to UTF-8 encodingAdrian Herrmann2022-09-291-4/+4
| | | | | | | | | Switch the encoding when reading example-related files (code, rst, pyproject etc.) to UTF-8 to enable special characters and 😊. Pick-to: 6.3 Change-Id: I6737875bc9b64d069b8adc478912f4ab4567e28e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* snippets_translate: Fix handling of operator new, take 2Friedemann Kleint2022-09-213-3/+24
| | | | | | | | | | Change e48dce39c1450e73f7cdef58cfeba29e1c3b8be3 introduced a bug appending "()" to member initalizer lists "m_member(new X()),". Fix that by using a regexp to loop through the expressions. Pick-to: 6.3 Change-Id: I6ce095749bcab74e92fb6dd630f25fb9fd517cc5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Handle more qualifiersFriedemann Kleint2022-09-211-9/+7
| | | | | | | | | | Use a set instead of regexps. Pick-to: 6.3 Change-Id: If9c05fffd4f5ebb880d21cd24fafc0be5698ee66 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Handle "new" without parenthesesFriedemann Kleint2022-09-162-1/+3
| | | | | | | | Pick-to: 6.3 Change-Id: Ic50c175fab1f362c4c15e12f78e5ec440784e20c Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Generate documentation for all modules independentlyFriedemann Kleint2022-09-151-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only the modules that were built in PySide were considered for documentation, which required one to create a full build just to build the documentation. One reason for this was that the inheritance diagram creation determined the base classes by loading the classes/modules and do introspection. This has been replaced by a mechanism were shiboken creates a JSON inheritance file. It is then sufficient to have the modules built in Qt so that the includes exist for shiboken and qdoc finds the source. Add a script that retrieves the Qt modules built by looking at the Qt include path, rearranges them by dependency order and use that as an input to the documentation checks. With that, a minimal build of PySide6 suffices to generate the complete documentation. The script can be used standalone with an option to print warnings about modules not built in Qt. Task-number: PYSIDE-1106 Change-Id: Iade4c6f1d3d255f7052be94d0a6fd647f5ee4ed3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Documentation: Fix example gallery after adding the PDF examplesFriedemann Kleint2022-09-131-1/+1
| | | | | | | | | Add further exclusions. Amends 322975d2262a5f31bfa5940451458702e82ee010. Change-Id: I22d68a3835969909fbc0518f327c563c0212dc11 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Use super() for base class initializationFriedemann Kleint2022-09-122-8/+8
| | | | | | | Pick-to: 6.3 Change-Id: Ie7642f45d59839a52a650abd47383e30e508b8d3 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Documentation/example_gallery: Use relative paths in auto-generated titlesFriedemann Kleint2022-09-121-4/+4
| | | | | | | | | | | | | | Currently, auto-generated titles show up as: /tmp/snapshot-pyside-6.3-rel/pyside-setup/examples/widgets/graphicsview/elasticnodes Use a path relative to the repository instead (examples/widgets/graphicsview/elasticnodes). Task-number: PYSIDE-2056 Pick-to: 6.3 6.2 Change-Id: Idbd301d4e2050517185d67c21ed2befb9e2b8506 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Speed up regexp evaluationFriedemann Kleint2022-09-022-93/+134
| | | | | | | | | | Precompile the regular expressions and store the stripped string. Brings down user time from 2.3s to 2s, approximately. Pick-to: 6.3 Change-Id: If929dc0c85cbe3e797bb3ec01eff9c434a8c5527 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Refactor handling of castsFriedemann Kleint2022-09-022-20/+15
| | | | | | | | | Use one non-greedy regexp instead of several ones. Pick-to: 6.3 Change-Id: I192476b5f184d22227fdd0e26ec9408098114b0e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Move qtpy2cpp to sources/pyside-toolsFriedemann Kleint2022-09-0211-1209/+0
| | | | | | | | Preparing the entry point. Task-number: PYSIDE-1945 Change-Id: I4a2fbe6d35b4f97bf0ab7cfc2085b86a40bc2558 Reviewed-by: Christian Tismer <tismer@stackless.com>
* fix bluetooth heart rate example snippet directoryCristiƔn Maureira-Fredes2022-08-291-6/+6
| | | | | | | | | | amends ba5fdf167b79444f210884aa01f484b5283ec67a Pick-to: 6.3 Task-number: PYSIDE-841 Change-Id: I03e06d77ce6dce0acaef1366f9fbde1dbbe05d0c Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add the Bluetooth heart rate examplesFriedemann Kleint2022-08-261-0/+19
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.3 Change-Id: If24127be2ab78b3542777fdf691227d51e628373 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Handle connect statementsFriedemann Kleint2022-08-173-3/+53
| | | | | | | | | | Replace pairs of instance/pointer to member functions (PMF) by the Python dot notation and connect statements afterwards. Pick-to: 6.3 6.2 Task-number: PYSIDE-1721 Change-Id: I29f01d47026e3a7ab2407cf8c5b112533d5fb4dc Reviewed-by: Christian Tismer <tismer@stackless.com>
* qtpy2cpp.py: Modernize the front-endFriedemann Kleint2022-08-161-34/+31
| | | | | | | | Use Pathlib, remove double quotes and remove the version check. Change-Id: I455ed97d1f734a43580451165da73f84a7eaa2cc Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Do convert return statements to functionsFriedemann Kleint2022-08-162-2/+6
| | | | | | | | Pick-to: 6.3 6.2 Task-number: PYSIDE-2030 Change-Id: Icd6f3a639449d737933d4420fbeb891224999b59 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Fix indented conditionsFriedemann Kleint2022-08-152-3/+4
| | | | | | | | | | Adapt the regexes accordingly. Pick-to: 6.3 6.2 Fixes: PYSIDE-2030 Change-Id: I6515b2ca0fe23c753feadeb491173b72889abba5 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Long live qtcpp2py.py!Friedemann Kleint2022-08-151-0/+63
| | | | | | | | | | | | Add a front-end to the C++ to Python conversion functions of snippets_translate. The command line logic is taken from qtpy2cpp.py for consistency. Task-number: PYSIDE-2030 Change-Id: I77ff5d68e387c483bb7de3d36dff52f3449b7880 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Fix the testsFriedemann Kleint2022-08-152-33/+57
| | | | | | | | | | | | Change c4a266e38fe5bdce707ad6b123fa88bb4f10dff3 broke the test by changing the function values and signature. Pick-to: 6.3 6.2 Task-number: PYSIDE-1984 Task-number: PYSIDE-2030 Change-Id: I88412f3f4398aa7fd0748d9ad3b7ba2a75cf9ff0 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix the modelview programming tutorialFriedemann Kleint2022-08-121-1/+38
| | | | | | | | | | | | | Add some documentation examples and snippets to fix most outstanding C++ to Python conversion errors. The rest looks roughly ok and could be improved by further fixing up the snippet conversion. Task-number: PYSIDE-1984 Pick-to: 6.3 6.2 Change-Id: I8c1bdcbc4a07847b2731ef7e2b9ba666cc00ccd6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Add a way of using snippets from PythonFriedemann Kleint2022-08-113-29/+140
| | | | | | | | | | | | | | Split a helper off the snippet extraction function taking the comment pattern and let it return a dict by id to make it possible to replace snippets by id. Prototypically use it for the modelview tutorial. Fixes: PYSIDE-1984 Task-number: PYSIDE-1952 Pick-to: 6.3 6.2 Change-Id: I05dbc3e36825761fe2968d6507880cd6f588682d Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Replace spaces in overridden snippet ids by '_'Friedemann Kleint2022-08-051-1/+2
| | | | | | | | | | | Amends 22bc41605a4dd18330a39f6346143ec55a7d6074. Manifests as "Quoting ModelView Tutorial". Task-number: PYSIDE-1984 Task-number: PYSIDE-1952 Pick-to: 6.3 6.2 Change-Id: Ie74080136d825adcdaf2348d2e2cd5db35ac1ff7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Add a way of overriding snippetsFriedemann Kleint2022-08-031-5/+36
| | | | | | | | | | | | Prototypically fix the QInputDialog dialog snippets. Task-number: PYSIDE-1984 Fixes: PYSIDE-1952 Pick-to: 6.3 6.2 Change-Id: Iad75971b8778a6364123963d28f54f02a0c56737 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippet translate: Fix errorFriedemann Kleint2022-08-021-13/+14
| | | | | | | | | | | | | Adapt to get_snippets() returning a list after 168f0c941cefe2fcdaaa12498272f181fe246986: File "pyside-setup-devt/tools/snippets_translate/converter.py", line 21, in snippet_translate if x.strip().startswith("content-type: text/html"): AttributeError: 'list' object has no attribute 'strip' Pick-to: 6.3 6.2 Change-Id: I3366b6fcf7647e24cf50ad7afe1f62ff0d04f9e2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix example_gallery tool failureFriedemann Kleint2022-08-021-1/+7
| | | | | | | | | | | | | Fix paths in chapter6-plugins.pyproject. Amends 5fbdfa3ec1df74368316ab0f3ab2ec03781e0df0. As a drive-by, improve error reporting in the tool. Task-number: PYSIDE-1878 Change-Id: Ib692946ebc4168785bba7f6dd39268fd9ea4e30d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* tools: update missing bindings script to 6.3CristiƔn Maureira-Fredes2022-07-253-56/+41
| | | | | | | Pick-to: 6.3 Change-Id: I893b995a616e7473fa81cbf5e51eaeeb1c90d2d3 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippet translate: add option to process directoryCristiƔn Maureira-Fredes2022-06-302-63/+100
| | | | | | | | | | | | Including option to process the snippets inside a directory, and refactoring the general script to adapt this option. Initial-Patch-by: Jaime Resano <gemailpersonal02@gmail.com> Pick-to: 6.2 6.3 Change-Id: I629be8b7c13bc0445279ced73c3159800cd0644d Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippet translate: fix get_snippetsJaime Resano2022-06-293-25/+128
| | | | | | | | | | - Fixed the get_snippets function which did not work properly when more than one snippet id was on the same line. - Tests were added Pick-to: 6.2 6.3 Change-Id: Idffbb0aee258522d7855e2ad0e2b8df61a1872c8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* snippet_translate double colon improvementsShyamnath Premnadh2022-06-242-3/+23
| | | | | | | | | | | | | | | | | | - Earlier, double colons were converted to dot operator only when the statement had a QObject class or namespace. For cases with a normal C++ namespace like MyClass::x, it was still translated without modifications to Python. - This patch adds an extra statement at the end of snippet_translate(x) to convert all the remaining scope resolution to dot operator On top of the above changes, it also addresses a FIXME to handle C++ iterator declaration in Python Task-number: PYSIDE-1972 Pick-to: 6.3 Change-Id: I45d12954835aaa569d1a4ef15badb366eaff0fe7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* qtpy2cpp: Set up test infrastructureFriedemann Kleint2022-06-216-200/+162
| | | | | | | | | | Add test code and move the files to baseline. Task-number: PYSIDE-1945 Pick-to: 6.3 Change-Id: I57975c774d53a4dc5f77ca671652ca32c04809de Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* qtpy2cpp: Further improvementsFriedemann Kleint2022-06-213-9/+10
| | | | | | | | | | | | | - Fix indentation of context manager scopes - Fix indentation of augmented assignments - Handle range based for over variable - Remove FIXME comment for function types - Write base name in header comment for testability Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: Ib30af672e56434c30d98f8dce2cb73ef0a1512a8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* qtpy2cpp: Handle "augmented assignment" (operator +=, -=)Friedemann Kleint2022-06-151-7/+24
| | | | | | | | | As a drive-by add missing operators -, /. Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: I6d43d5e03930232ebba1d0d6308f70d03fafde03 Reviewed-by: Christian Tismer <tismer@stackless.com>
* qtpy2cpp: Qualify the Qt namespace with "::" instead of "->"Friedemann Kleint2022-06-102-3/+10
| | | | | | | Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: I1be5386df81bd548a72b86dfee1474a6c8b941a2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* qtpy2cpp: Handle indexesFriedemann Kleint2022-06-101-0/+10
| | | | | | | Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: Idb4f34931bc00e5677e95faa231b5dbf071dfb70 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* qtpy2cpp: Improve function definitionsFriedemann Kleint2022-06-042-12/+83
| | | | | | | | | | | | | | | - Handle type annotations in function definitions with some heuristics how to pass typical Qt classes. - Fix the formatting of default parameters. - Handle Slot decorators. - Ignore the above elements later when the parser traverses them Introduce concenience functions for checking visitor scope. Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: I489088025b0d6a76d43da6154af4db58b748adbe Reviewed-by: Christian Tismer <tismer@stackless.com>
* qtpy2cpp: Handle context managersFriedemann Kleint2022-06-031-0/+20
| | | | | | | Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: I70dd4c139ef690964f1a65c6d995a0112d3dcfa3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* qtpy2cpp: Move Qt class information to a separate fileFriedemann Kleint2022-06-033-11/+59
| | | | | | | | | Add some flags for more fine-grained information. Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: Ib195284d1c9ee4d50fe8bce25f96c499967262e7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* qtpy2cpp: Handle multiple file argumentsFriedemann Kleint2022-06-011-26/+26
| | | | | | | Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: If994c572ed5cdbac6536968160153c721b5f1473 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* qtpy2cpp: Handle chained function calls a()->b()->c()Friedemann Kleint2022-06-011-2/+33
| | | | | | | Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: I41d32000d4221f604fe87dd36ece3f287e9b1a30 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* qtpy2cpp: Handle main()Friedemann Kleint2022-06-011-0/+25
| | | | | | | | | | Check for the if __name__ == '__main__' statement and convert that into a C main function. Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: I75e38aca9ebc9dc0f79dc97a18e61c28b6b17505 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* qtpy2cpp: Improve construction of Qt classesFriedemann Kleint2022-06-011-2/+47
| | | | | | | | | | | | | Check if a variable assignment is likely a construction of a Qt class. Add some smartness there, construct some classes on stack and add "new" for the others. Store stack variables per function scope in a list for future use. Task-number: PYSIDE-1945 Pick-to: 6.3 Change-Id: Id71d1a8c14e57f3bfaf32fc202b260d390589382 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* qtpy2cpp: Add return tokenFriedemann Kleint2022-06-011-2/+7
| | | | | | | | | | | As a drive-by remove some new lines produced which were apparently necessary due to the missing handling of return statements. Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: Id8187b599e3163c2b6e5359c4a79214f70fe4b1d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* qtpy2cpp: Improve error handlingFriedemann Kleint2022-06-013-10/+13
| | | | | | | | | | | Format messages in a file:line: format. Fix an error causing an exception. Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: I16a1fd6daa96521adfe53f23090f61fbbc581e84 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* qtpy2cpp: Add more operatorsFriedemann Kleint2022-05-312-2/+42
| | | | | | | Pick-to: 6.3 Task-number: PYSIDE-1945 Change-Id: I802ded1388918a8f5b72f8f9382a052e09e936ee Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Use SPDX license identifiersLucie GƩrard2022-05-2729-1059/+58
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* flake8: fix styling issues in tools/CristiƔn Maureira-Fredes2022-04-0222-139/+132
| | | | | | Change-Id: I8cbf5d521900df4f55abf8f68997f8a71437f722 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* doc: use https in some source code filesCristiƔn Maureira-Fredes2022-03-311-2/+2
| | | | | | | Pick-to: 6.2 Change-Id: Ic48c1016638cb6fca544139ef589223b45c656c7 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>