aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials/cannon/t14.py
Commit message (Collapse)AuthorAgeFilesLines
* examples: fix flake8 issues and add exceptionsCristián Maureira-Fredes2024-01-251-1/+1
| | | | | | | | | | 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 1)Adrian Herrmann2023-12-061-1/+2
| | | | | | | | | 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-281-2/+2
| | | | | | | | Mostly spacing related. Pick-to: 6.6 Change-Id: If0d5b25e1c60b7b216f970d1e57613f00bd04a37 Reviewed-by: Adrian Herrmann <adrian.herrmann@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-211-3/+3
| | | | | | Change-Id: I0aad3aefb2f036bf4edc2d0942f007045d605e26 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-271-40/+2
| | | | | | | | | | | 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-011-1/+1
| | | | | | 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-261-15/+12
| | | | | | | | | | | | | | | 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-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: use exec() instead of exec_()Cristian Maureira-Fredes2021-05-051-1/+1
| | | | | Change-Id: I07dd4339093be8fcc80e63a2ff0448e998356203 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Cannon tutorial: Brush up codeFriedemann Kleint2021-04-221-124/+122
| | | | | | | | | | | | - 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-241-152/+152
| | | | | | Task-number: PYSIDE-1112 Change-Id: I60056e1cf0bac1279b7ff780fba908643339847e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Replace % formatting in examples by f-stringsFriedemann Kleint2021-03-221-2/+2
| | | | | | | | 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-091-0/+450
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>