aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews
Commit message (Collapse)AuthorAgeFilesLines
* examples: fix flake8 issues and add exceptionsCristián Maureira-Fredes2024-01-252-2/+2
| | | | | | | | | | 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-061-4/+4
| | | | | | | | | | 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-068-28/+30
| | | | | | | | | 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-285-9/+10
| | | | | | | | 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-5/+2
| | | | | | Change-Id: I88a7bb2fe91abcfdef6e6014b088d08c4e613893 Pick-to: 6.5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix the editabletreemodel exampleFriedemann Kleint2022-10-061-7/+2
| | | | | | | | | Remove the duplicated signals and fix the signal emission. Task-number: PYSIDE-2070 Pick-to: 6.3 6.2 Change-Id: I6020d0d3b971de699ace9da5332a5e173c1fba8f Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add the dirview exampleFriedemann Kleint2022-09-263-0/+68
| | | | | | | | | This works after changing Enum to allow missing values. Pick-to: 6.3 6.2 Task-number: PYSIDE-841 Change-Id: I29f145280a19a06a9586c4f240a22dc2a7b2fe19 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: fix unused imports and minor errors in 'widgets'Cristián Maureira-Fredes2022-09-211-2/+1
| | | | | | Change-Id: I0aad3aefb2f036bf4edc2d0942f007045d605e26 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Add title to the SpinBoxDelegate docVenugopal Shivashankar2022-09-061-0/+3
| | | | | | | | | Amends 89e5d35c0f002fcb1aac3b1205402ce306074255. Task-number: PYSIDE-1984 Change-Id: I09e74d2c3494ea263f988492cc09b2270137ad6a Pick-to: 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Add some missing slot decoratorsFriedemann Kleint2022-08-245-6/+15
| | | | | | | | | | 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>
* Port the SpinBoxDelegate exampleFriedemann Kleint2022-08-103-0/+83
| | | | | | | | Task-number: PYSIDE-1984 Pick-to: 6.3 6.2 Change-Id: I91eadd56d87e95c7ff440d5625e41046c0a5341b Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6-examples: SpreadSheet exampleAdrian Herrmann2022-07-206-0/+762
| | | | | | | | Port pre-existing SpreadSheet example to PySide. Pick-to: 6.2 6.3 Change-Id: I32d014fbd5e3e406672b6bec2465c6e41c3a6580 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-2715-609/+44
| | | | | | | | | | | 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-0114-15/+15
| | | | | | 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-4/+2
| | | | | | | | | | | | | | | 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>
* Add editable tree model exampleJaime Resano2022-01-268-0/+680
| | | | | | | | | | Ported from C++. Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Done-with: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Pick-to: 6.2 Change-Id: I9336016daec01b0b0486fcd39fac20c6bbd08970 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* 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: add screenshots to widgets and othersCristian Maureira-Fredes2021-06-1211-4/+21
| | | | | | | | | | | | | | | 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: clean and improve codeCristian Maureira-Fredes2021-05-133-5/+5
| | | | | | | | | | - removing '\' from long lines, - use f-strings instead of concatenating strings - Use f-strings instead of the old '%' formatting Task-number: PYSIDE-841 Change-Id: I4983c25a6272e10119d5d1a74c180828ca6f64e6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: avoid built-in functions names as variableCristian Maureira-Fredes2021-05-121-3/+3
| | | | | | | | | There were many variable names using built-in python functions so this patch renames them to something safe. Task-number: PYSIDE-841 Change-Id: Iade34711ba31797f08f3f924be05023a7f12d5ef Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: use exec() instead of exec_()Cristian Maureira-Fredes2021-05-058-11/+11
| | | | | Change-Id: I07dd4339093be8fcc80e63a2ff0448e998356203 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix some space-related flake warningsFriedemann Kleint2021-04-297-4/+9
| | | | | | 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-289-10/+10
| | | | | | Task-number: PYSIDE-1112 Change-Id: Ifcb4da974bdcad7af536404fffdbffc585d3d167 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rewrite the fetchmore exampleFriedemann Kleint2021-04-221-48/+77
| | | | | | | | | | | | | | | - Use per class imports - Start in root folder so that large directories (/bin/, Windows) are easily reachable - Remove the line edit and navigate by doubleclicking instead since this is more on line with expectations - Use a QPlainTextEdit for logging - Make the log message more informative - Add icons Task-number: PYSIDE-1112 Change-Id: I09663c40331df149cc15735f36f2553236759573 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add an editable Json Model exampleSacha Schutz2021-04-153-0/+389
| | | | | | | | | | | This is an adaptation of my code available on https://github.com/dridk/QJsonModel. Due to its success, it may be good to add it into the official documentation. Pick-to: 6.0 Task-number: PYSIDE-841 Change-Id: I5b9acddb684ba27233efa53e6b0e04291aaba46a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Port QWidget examples to snake caseFriedemann Kleint2021-04-069-301/+301
| | | | | | Task-number: PYSIDE-1112 Change-Id: Ia42e395a3c650f4c11f05cfe5c6f67d309c4a3d3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Replace .format() in examples by f-stringsFriedemann Kleint2021-03-231-1/+1
| | | | | | | | As a drive by, fix the chartthemes example to work. Task-number: PYSIDE-1112 Change-Id: I35deeba69f2db2c8c0848cce7316fb621b1b5818 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Replace % formatting in examples by f-stringsFriedemann Kleint2021-03-222-11/+12
| | | | | | | | 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>
* doc: migrate qdoc approach to document examplesCristian Maureira-Fredes2021-03-172-0/+10
| | | | | | | | | | | | | | | | | There were two previous documented examples using the approach based on qdoc: stardelegate, and classwizard. This patch moves them into the 'doc/' directory for each example, and partially revert the changes from 308157f01260c640e21f6972619d3b380c007acb Additionally, an unrelated screenshot was moved to a new general 'images/' directory. Task-number: PYSIDE-1112 Pick-to: 6.0 Change-Id: I239a24fa4e4f970540857ba8b33b9b13c18142b1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: directory structureCristian Maureira-Fredes2021-02-095-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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-0210-25/+25
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-121-54/+65
|\ | | | | | | Change-Id: I7f16e4f178bff9c37af3b7a9d536c5d6f42c66fb
| * Brush up the basicsortfiltermodel exampleFriedemann Kleint2020-10-091-54/+65
| | | | | | | | | | | | | | | | | | | | | | | | Replace the deprecated QRegExp by QRegularExpression, introducing an enumeration for the filter types as is done in the C++ example. Import classes. Task-number: PYSIDE-841 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I6aa1bc2b325bb5168c70be3c28a59c5c7629fe3e Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-07-071-4/+5
|\| | | | | | | Change-Id: I299a65f15fb6b7eb900256590bbe76ad0568f546
| * Port some examples from QRegExp to QRegularExpressionFriedemann Kleint2020-07-061-4/+5
| | | | | | | | | | | | | | | | | | QRegExp is deprecated. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I5c5dc4965a03fbd1a3370be3fa9e64c5df6a9fd8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Initial port of Core,Gui,Widgets,Network,Qml,Quick to Qt 6Friedemann Kleint2020-07-031-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | Test failures: shiboken2:testmodifyfunction pyside2:QtCore::qbytearray_test pyside2:QtGui::bug_PYSIDE-41 pyside2:QtGui::deepcopy_test pyside2:QtGui::qfontmetrics_test pyside2:QtGui::qpixmapcache_test pyside2:QtWidgets::api2_test (QTBUG-85417) pyside2:QtWidgets::bug_632 pyside2:QtWidgets::bug_714 pyside2:QtWidgets::bug_785 pyside2:QtWidgets::qshortcut_test pyside2:QtQml::bug_825 pyside2:QtQml::bug_1029 pyside2:QtQml::registertype pyside2:QtQml::qqmlincubator_incubateWhile pyside2:QtQml::signal_arguments Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia43d7ed037dfdd07def0edd76bada2243e73d335 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Examples: Adapt to new qApp variableFriedemann Kleint2020-02-251-2/+2
| | | | | | | | Amends d579912b31d7cfa7b0b216916fbbf3eb632a9d9d. Task-number: PYSIDE-571 Change-Id: Ide49ef2c9f99335b5019daea7d27cd1d86e896a4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: improve the star delegate exampleSamuel Gaist2020-01-272-3/+4
| | | | | | | | | | | | | While the example works correctly as is, if one takes the StarEditor class alone, it will fail to work as it uses a starRating attribute that is available in the example only because of the call to setEditorData by the StarDelegate class. This patch fixes that as well makes use of the append overload of QPolygonF taking a list of point to simplify the code a bit. Change-Id: Id8132fa86f5668645f48c62377dac65f707c968b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: remove unused importsCristián Maureira-Fredes2020-01-063-5/+4
| | | | | Change-Id: I85216bcfc23161b832ecb675ea58f33e67004fe9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add .pyproject files for each exampleCristián Maureira-Fredes2019-09-273-0/+10
| | | | | Change-Id: I4dec66067aa2b0cc50d1ac3226537e4f09006132 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Change example scripts permissions to 644Cristian Maureira-Fredes2018-12-1210-10/+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-0310-10/+10
| | | | | | | | | | | | | | | | | 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-1210-0/+1450
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>