aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials
Commit message (Collapse)AuthorAgeFilesLines
* examples: fix flake8 issues and add exceptionsCristián Maureira-Fredes2024-01-2511-11/+11
| | | | | | | | | | Exception for: - qApp and tr not being directly imported: F821 - *rc and qml modules being imported but not used: F401 Pick-to: 6.6 6.5 6.2 Change-Id: I5e40f3f54c1721ef3dc5d7f1e87d5fd8ec771b8e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix a number of flake8 errors (part 3)Adrian Herrmann2023-12-064-4/+0
| | | | | | | | | | Fix unused variable errors and other miscellaneous errors not included in parts 1 and 2. Pick-to: 6.6 Change-Id: Ifb4336cd4ecdd62928042e1011d4430a461efc7c Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix a number of flake8 errors (part 1)Adrian Herrmann2023-12-069-81/+74
| | | | | | | | | First batch, including low-hanging fruit like Alignments, whitespaces, line length, indents, etc. Pick-to: 6.6 Change-Id: I55966876077f7fddfdc82cbe376677af9995f329 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix some flake warningsFriedemann Kleint2023-11-289-12/+15
| | | | | | | | Mostly spacing related. Pick-to: 6.6 Change-Id: If0d5b25e1c60b7b216f970d1e57613f00bd04a37 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* examples: remove unused importsCristián Maureira-Fredes2023-04-051-3/+2
| | | | | | Change-Id: I88a7bb2fe91abcfdef6e6014b088d08c4e613893 Pick-to: 6.5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: adapt widgets examplesCristián Maureira-Fredes2022-10-061-1/+1
| | | | | | | | | Fixing issues related to deprecated methods, Enums, and more. Pick-to: 6.3 Change-Id: I07be29601f0ad257f5fcfb0a5bc4891cb7f9648c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: fix unused imports and minor errors in 'widgets'Cristián Maureira-Fredes2022-09-2115-24/+21
| | | | | | Change-Id: I0aad3aefb2f036bf4edc2d0942f007045d605e26 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Add some missing slot decoratorsFriedemann Kleint2022-08-245-0/+32
| | | | | | | | | | As unearthed by the warnings added by the logging category. As a drive-by, fix some imports. Pick-to: 6.3 6.2 Task-number: PYSIDE-2033 Change-Id: I3812c705b60eb7be744c3532fcfb0e4024763885 Reviewed-by: Christian Tismer <tismer@stackless.com>
* snippets_translate: Add a way of using snippets from PythonFriedemann Kleint2022-08-117-3/+22
| | | | | | | | | | | | | | 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>
* Port the modelview tutorialsFriedemann Kleint2022-08-109-0/+377
| | | | | | | | | Planning to add a mechanism to extract snippets from them. Task-number: PYSIDE-1984 Change-Id: I0277ec27cb1eea85af8a921395374fc30935c99c Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-2721-847/+49
| | | | | | | | | | | 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>
* examples: replace http by httpsCristián Maureira-Fredes2022-04-0121-21/+21
| | | | | | Pick-to: 6.2 Change-Id: Ib53667e03a2dea2afea73a344d5749d37d59c52b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: Turn most QPainter instances into context managersChristian Tismer2022-01-267-70/+50
| | | | | | | | | | | | | | | After the new context manager is in place, most of the examples benefit from moving QPainter into a `with` statement. The comments concerning PyPy could be removed, again. [ChangeLog][PySide6] The examples are updated to use the new context manager for QPainter. Task-number: PYSIDE-535 Change-Id: Idf7e1f734d549ed663383ffbb2416297ebb1e0c7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: handle QPainter correctly with GCChristian Tismer2022-01-247-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While testing the examples with PyPy, a number of examples used QPainter without explicitly calling painter.end() and crashed. This works in standard Python, but leaves the painter open in other implementations, because the implicit deletion of objects when going out of scope does not work in the wrapper when garbage collection is used. Fixed by providing the missing painter.end() calls. This problem should finally be fixed by making QPainter a context manager. The same approach was taken by Python.org and the file open/close functions. The context manager was needed for implementations like IronPython, Jython and PyPy. [ChangeLog][PySide6] The examples were adapted to PyPy's need to close QPainter, explicitly. Eventually, we may turn this into a context manager. Change-Id: I18eeeff7df800bafce91a1e5c98c469aa3bcc41b Pick-to: 6.2 Task-number: PYSIDE-535 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: add screenshots to widgets and othersCristian Maureira-Fredes2021-06-124-0/+17
| | | | | | | | | | | | | | | Adding screenshots to: - declarative - multimedia - network - widgets Renaming examples to avoid conflict on images names. Task-number: PYSIDE-841 Pick-to: 6.1 Change-Id: I21f403ee62b45c0cb2a45eca6c5c99f11901610e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: use exec() instead of exec_()Cristian Maureira-Fredes2021-05-0521-24/+24
| | | | | Change-Id: I07dd4339093be8fcc80e63a2ff0448e998356203 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix some space-related flake warningsFriedemann Kleint2021-04-294-8/+8
| | | | | | Task-number: PYSIDE-1112 Change-Id: Ib8991199e4822673d6a25cba0023dbe3b03f5938 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Examples: Use new form of super()Friedemann Kleint2021-04-287-10/+10
| | | | | | Task-number: PYSIDE-1112 Change-Id: Ifcb4da974bdcad7af536404fffdbffc585d3d167 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remaining examples: Use per-class importsFriedemann Kleint2021-04-237-234/+260
| | | | | | Task-number: PYSIDE-1112 Change-Id: I8534e911959d6eed2ed6d3f7741e99929ff0125e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Cannon tutorial: Brush up codeFriedemann Kleint2021-04-2214-630/+642
| | | | | | | | | | | | - Use per class imports - Remove string-based connections, fixing some errors introduced by the snake case renaming - Add some spacing and indent main - Use math.pi Task-number: PYSIDE-1112 Change-Id: I2171fc9eb27f9926f32648a289df404d390ace43 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Port the widget tutorials to snake caseFriedemann Kleint2021-03-2415-1327/+1327
| | | | | | Task-number: PYSIDE-1112 Change-Id: I60056e1cf0bac1279b7ff780fba908643339847e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Replace % formatting in examples by f-stringsFriedemann Kleint2021-03-2213-55/+55
| | | | | | | | As drive-by, Fix fortune server, addressbook and dombookmarks examples to work. Task-number: PYSIDE-1112 Change-Id: I8ef7759ed56aeb7157cf2222bee9b6481973112a Reviewed-by: Christian Tismer <tismer@stackless.com>
* Port examples away from deprecated QMouseEvent::pos()Friedemann Kleint2021-03-191-2/+2
| | | | | | | | | | As a drive by, fix the left-over QtCharts callout example to work after 227020b118fa38ada1d8bd579593dae61f6e3881. Pick-to: 6.0 Task-number: PYSIDE-1122 Change-Id: I945b57950014e882d4efd3cb0cab47262ad108b6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: directory structureCristian Maureira-Fredes2021-02-0915-0/+2449
| | | | | | | | | | | | | | | | | | | | | | | | When generating the gallery automatically, the structure of the examples was not the same for all the modules. This reorganization was made under the following assumption: An example requires: - its own directory, - a '.pyproject' file, - one or more '.py' files, - extra files (likes images, .rc, .ui, etc) Even for cases when subdirectories are made to depict categories, like 'widgets/state-machine/...', one directory is required per example. There should not be '.pyproject' files for categories, except for the general 'examples.pyproject' to open all of them. Task-number: PYSIDE-1490 Pick-to: 6.0 Change-Id: Ie690773c816a248016dbebaad90fbb1d1c2aeea5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-027-7/+7
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: remove unused importsCristián Maureira-Fredes2020-01-067-7/+7
| | | | | Change-Id: I85216bcfc23161b832ecb675ea58f33e67004fe9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add .pyproject files for each exampleCristián Maureira-Fredes2019-09-271-0/+4
| | | | | Change-Id: I4dec66067aa2b0cc50d1ac3226537e4f09006132 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Remove unnecessary show() in tutoralCristián Maureira-Fredes2019-03-146-6/+0
| | | | | Change-Id: I0a72f484fb5591f8c1d47fa534407c8e15cdb396 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change example scripts permissions to 644Cristian Maureira-Fredes2018-12-127-7/+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>
* Change license from all the filesCristian Maureira-Fredes2018-05-037-7/+7
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Move examples from submodule to pyside-setupFriedemann Kleint2018-01-127-0/+2070
Move PySide2 examples that are owned by the Qt Company to a new examples directory. Done-with: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Task-number: PYSIDE-363 Change-Id: I14099764d9eef2bc35e067086121427955862e3a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>