aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Modernize helper tool dump_metaobject.pyFriedemann Kleint2022-03-022-26/+37
| | | | | | | Pick-to: 6.2 Change-Id: Id53d9eeb189a190a5b5e7535a9994c213c01fd3c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* create_changelog: Add sample usageFriedemann Kleint2022-03-011-1/+8
| | | | | | Pick-to: 6.2 Change-Id: Ia0dcfcbf4ea14e4f59258f572ee3308e6ef42268 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add a tool to regenerate the ui files of the PySide examplesFriedemann Kleint2022-01-141-0/+73
| | | | | | | | | Similar to ebf0259817956bf8932fb8f25e7ac90e6a7d7501. Pick-to: 6.2 Task-number: PYSIDE-1773 Change-Id: I93f36fc3203936d0617aa25085f3513df79ac97b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add a tool to regenerates the QRC resource files of the PySide examplesFriedemann Kleint2021-12-151-0/+97
| | | | | | | Hardcode the regeneration of the .qm files in the linguist example. Change-Id: Ibc7d21ec6ad0f3f83b5aeaefcfe15bd9487ee527 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Turn snippets_translate / example_gallery into normal CMake targetsFriedemann Kleint2021-12-091-1/+1
| | | | | | | Pick-to: 6.2 Change-Id: Ib318e8f90dda38566da11877ab52f32eba4762f6 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Documentation: Generate the examples directly into the build directoryFriedemann Kleint2021-12-081-0/+4
| | | | | | Pick-to: 6.2 Change-Id: If395979b5a1efa869b3c1c7cb12b53bd1e8f1f7c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* example_gallery: Handle dummy projects in the doc directoryFriedemann Kleint2021-12-081-19/+21
| | | | | | | | | | | | | Make it possible to have a dummy pyproject file with entries pointing to the parent directory in the doc directory as not to clash with a CMakeLists.txt in the examples directory. Separate the code paths for the pyproject_file and the actual examples directory for this purpose. Pick-to: 6.2 Change-Id: I0a1e583bff8cbb8243ba7526b8b2908f6a3e6e9c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Documentation: Loosen snippet patternFriedemann Kleint2021-12-082-1/+54
| | | | | | | | | Some examples(queuedcustomtype, codeeditor) use '//![snippet]'. Change-Id: If13fd12f8eff8a41a3b8e4f74a7bf3a03c8b39b3 Pick-to: 6.2 Task-number: PYSIDE-1721 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* example_gallery: Support more lexersFriedemann Kleint2021-12-071-2/+8
| | | | | | Pick-to: 6.2 Change-Id: I5ed9a304d061b234fb081ca552d6b732fd370e8e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Documentation: Remove the snippets copy stepFriedemann Kleint2021-12-071-12/+7
| | | | | | | | | | This is no longer necessary since the snippets have been removed from the repository. Generate them directly into the build directory. Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: I0a4d9bc3c466b689fa28a982f608104cc5936570 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Documentation: Fix snippets resolutionFriedemann Kleint2021-12-071-64/+13
| | | | | | | | | | | | | | | | | Change snippets_translate to replicate the complete Qt tree including module name under the codesnippet directory. Resolving the snippet is then a matter of replacing the Qt source path by the PySide 6 snippet path in the fallback paths contained in WebXML and checking for the converted .py files. This basically reduces the snippet warnings to 0. Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: I344004ddd1580f96ebf0c132923388ad08852374 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Enable all modulesFriedemann Kleint2021-11-292-12/+25
| | | | | | | | | | | | | Fix a fixme commment. To make this pass, make the conditions matches more strict and add some warnings and error handling. Remove the checking of stderr from the CMake statement as this will produce some warnings. Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: I8aeefa8355144d98524a622733d82d337cd3c23b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix customgeometry.pyproject fileFriedemann Kleint2021-11-291-4/+5
| | | | | | | | | | | | | | | It caused: File "tools/example_gallery/main.py", line 298, in <module> content_f += get_code_tabs(pyproject["files"], out_f) KeyError: 'files' Amends b9ec49942b3ad53343317e631320c58e59736c22. As a drive-by, handle the error in the gallery tool. Pick-to: 6.2 Change-Id: Ideca9ccb72021780cf8ae7b3f2204733cc2f5e4f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Fix broken loggingFriedemann Kleint2021-11-271-1/+1
| | | | | | | | | Amends 742a39962f1ba9c0e42f387394768c13793144c0 Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: Ib1cbfd99a7a96e902df4f273c0b997e694a6a7a9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Handle header files as wellFriedemann Kleint2021-11-271-7/+4
| | | | | | | | | Use suffix .h.py for them to distinguish them from .cpp files. Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: Iea4bfa770833f319b65c1ea7f83fb1a325ce8c62 Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Streamline writing filesFriedemann Kleint2021-11-271-12/+12
| | | | | | | | | | | | | | The code created all example directories first and extracted the snippets to .cpp files which were later moved to .py files to overwrite the snippets in the repository (back then). Write to the Python file directly and create the directory only when needed. This removes a lot of empty directories. Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: I38e695db4aae386be18cd3b85708f684bfa228d5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Fix example pathFriedemann Kleint2021-11-271-1/+1
| | | | | | | | | Remove superfluous doc/codesnippets element. Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: Iff81bf9b3dc7a26d3f9c8924a450508ccbdb1dd4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* snippets_translate: Fix parsing of overlapping snippetsFriedemann Kleint2021-11-261-41/+42
| | | | | | | | | | | Change get_snippets() to return a flat list of all snippets. It internally uses a list of active snippet ids to decide whether a line should be included. Pick-to: 6.2 Task-number: PYSIDE-1721 Change-Id: Ifaa313a7aaa36dd125767b8b0c50a25db637c0ed Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* debug_windows.py: Fix --help handlingFriedemann Kleint2021-11-251-13/+13
| | | | | | | | | | Pass the unmodified arguments to the arguments in case help was requested. Add the verbose description text as an epilog. Also display help when invoked without administrative privileges. Pick-to: 6.2 Change-Id: I1580afbda1455be6d4ddedc6390f4d6f24990b83 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* example_gallery: Improve error handlingFriedemann Kleint2021-11-231-5/+13
| | | | | | | | | Print error messages about invalid JSON project files and decoding errors caused by binary files. Treat .jpg files as binary files. Pick-to: 6.2 Change-Id: I3d40789fc4680c7f2918a7a23c3d4fcc98ce9f81 Reviewed-by: Christian Tismer <tismer@stackless.com>
* tools: improve and modernize debug_renamer.pyChristian Tismer2021-10-041-34/+50
| | | | | | | | | | | | | | | | This tool needed an enhancement for usage in PyPy debugging and dump comparison. - added argparse and options to use files for input/output - added option "-r" for renaming action - added option "-f" for hiding time output More actions can easily be added, feel free to add one. Task-number: PYSIDE-535 Pick-to: 6.2 Change-Id: I747f3eb9aad8f8d358af6f4d850d9750a7cff8ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* debugging: Improve debug_renamerChristian Tismer2021-09-291-0/+3
| | | | | | | | | When dealing with NULL variables, don't rename the variable which would prevent locating an error. Task-number: PYSIDE-535 Change-Id: I48ae4bfd8d13a572c0c51d5af56dae87a765ee26 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* create_changelog.py: Improve formatting, sort change log entriesFriedemann Kleint2021-09-281-24/+50
| | | | | | | | | | | | - Wrap the text to 80 columns by using textwrap.fill(). - Strip the "shiboken6" and "PySide6" prefixes from the commit messages - Sort the change log entries by task number (change them into a list of tuples task number/string). Pick-to: 6.2 Change-Id: I770e17d749e71b7a4dec124df6050ed690020568 Reviewed-by: Christian Tismer <tismer@stackless.com>
* doc: improve tutorials and stylingCristián Maureira-Fredes2021-09-091-0/+3
| | | | | | | | | | | | | - Creating screenshots for tutorials. - Add gallery style for tutorials. - Add corporate Icons to the frontpage. - tools: Reduce example long names in the gallery. - videos: new order using panels - Add tutorial about "Why Qt for Python" Change-Id: I3ba50f74998399a47b4a34c1de029f3b746aa1e2 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>