aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Port examples away from deprecated QMouseEvent::pos()Friedemann Kleint2021-03-192-4/+4
| | | | | | | | | | 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>
* doc: migrate qdoc approach to document examplesCristian Maureira-Fredes2021-03-174-0/+21
| | | | | | | | | | | | | | | | | 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>
* doc: use 'doc' directory for examples galleryCristian Maureira-Fredes2021-03-172-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial patch that generates a gallery based on the examples in the respository, was limited to only showing the content of the files in each '.pyproject' file. That approach didn't allow to describe each example, nor add complementary images, like screenshots to each example page. This patch introduces the option to consider everything inside a 'doc/' directory on the example directory. The files that are copied over are not directory, but only files, for images to be the main focus. For example, currently the Tetrix case contained the following files: $ ls examples/widgets/tetrix/ tetrix.py tetrix.pyproject On this patch you can see that now there is a doc directory with the following content: $ ls examples/widgets/tetrix/doc tetrix-screenshot.png tetrix.rst The example page that will be generated for this case will contain the content of the 'doc/tetrix.rst' file, plus the content of all the project files at the end. The 'doc/tetrix.rst' file contains a reference to the 'tetrix-screenshot.png' image, so that file will be copied over too. Task-number: PYSIDE-1112 Pick-to: 6.0 Change-Id: I2d11833c461d8073d2d2888576d876d3f834103a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Port the imageviewer exampleFriedemann Kleint2021-03-023-0/+380
| | | | | | Task-number: PYSIDE-841 Change-Id: Icb833db3bf18e6943b0579a3a3a064024d57e084 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Add the logo as a resource to libpysideFriedemann Kleint2021-02-101-0/+1
| | | | | | | | Use it in prominent examples. Pick-to: 6.0 Change-Id: Ifee67802194931bbd56fbe6e6bfa4f3c18fda781 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: directory structureCristian Maureira-Fredes2021-02-0965-226/+2512
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* PySide6: Re-add QStateMachineFriedemann Kleint2021-01-269-35/+50
| | | | | | | | | | | | The code was moved from QtCore into a separate library, QStateMachine, within the qtscxml repository. Re-add tests and fix examples. Task-number: PYSIDE-904 Task-number: PYSIDE-1482 Change-Id: I977b4835b3345fb342c369e4fdd92646118f7fda Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-0275-144/+144
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: Remove Python 2.7 and <3.6 related codeCristian Maureira-Fredes2020-10-282-10/+1
| | | | | | | | | | * removing from __future__ import ... * updating CMakeLists.txt files * removing special if-else for Python 2 and 3 Change-Id: I8a34b06b6b384ebc5323f20f7c15c357a5be6d62 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-124-68/+85
|\ | | | | | | 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>
| * Replace deprecated API in examplesFriedemann Kleint2020-10-083-14/+20
| | | | | | | | | | | | | | | | | | | | | | - Replace qrand() by QRandomGenerator - Replace QMatrix by QTransform Task-number: PYSIDE-841 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I8609a9ce90a6df1cb7c7f1b9aab61695edf41a3f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix some examples to run with Qt 6Friedemann Kleint2020-10-081-1/+2
| | | | | | | | | | | | | | | | Task-number: PYSIDE-841 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ide9c869d73d14c56c06e39c0e2447761595978c9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-061-49/+54
|\| | | | | | | Change-Id: I7b4ff138799ee81940c36e68a105cb42bb38a3ff
| * Polish the flow layout exampleFriedemann Kleint2020-10-021-49/+54
| | | | | | | | | | | | | | | | | | | | - Import by class - Rename variables and functions, - Fix long lines Task-number: PYSIDE-841 Change-Id: Icb4615e15d0b54d3e2893ffa7981ced7b7526952 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-08-311-55/+56
|\| | | | | | | Change-Id: Icf4b3535be52b64ef15eced7103bb1280e031e30
| * Polish the syntaxhighlighter exampleFriedemann Kleint2020-08-201-55/+56
| | | | | | | | | | | | | | | | Rename variables and functions to snake case and streamline code. Change-Id: Ia4d1b36f5cebfe8ef58f161bafa3e1628109c865 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix a few examples to workFriedemann Kleint2020-07-278-12/+13
| | | | | | | | | | | | | | | | | | Adapt to the Qt 6 API. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia471ae8acc454dbbdd05700d08aee5bd6a265cee Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add QtOpenGLWidgetsFriedemann Kleint2020-07-141-288/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLWidget has been moved from QtWidgets into a separate library. Fix the examples and remove obsolete examples using deceased QGLWidget. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ib291d49c22ee6a32d7c03b6ff4980e87c8a09ecb Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-07-073-29/+38
|\| | | | | | | Change-Id: I299a65f15fb6b7eb900256590bbe76ad0568f546
| * Port some examples from QRegExp to QRegularExpressionFriedemann Kleint2020-07-063-29/+38
| | | | | | | | | | | | | | | | | | 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-036-27/+28
|/ | | | | | | | | | | | | | | | | | | | | | | | | 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>
* example: add systray exampleCristian Maureira-Fredes2020-05-158-0/+2922
| | | | | | | | | Adding an example with systray functionality, since we didn't have any in our repo. Task-number: PYSIDE-841 Change-Id: I7df67c55d38c1f98f9e4c28c82e6253bae494272 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Friedemann Kleint2020-03-231-1/+1
|\
| * Examples: Remove qApp importFriedemann Kleint2020-03-161-1/+1
| | | | | | | | | | | | | | | | | | Amends 5d34d60418b15d4d6837d0a1333f2b57631309eb, d579912b31d7cfa7b0b216916fbbf3eb632a9d9d. Task-number: PYSIDE-571 Change-Id: I214d7bf1770667eaa9abaea0f96b5e507b4c32f7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add a widget gallery exampleFriedemann Kleint2020-03-233-0/+488
|/ | | | | | | | | Port the widget gallery example added to Qt 5.15 by qtbase/7b0f34187224fe754f4171f1d2fe5fa3f48baf82 to Python. Change-Id: If70e5dd3a8b08fbf8aed1c894a374fffdebc6f57 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Examples: Adapt to new qApp variableFriedemann Kleint2020-02-255-7/+7
| | | | | | | | Amends d579912b31d7cfa7b0b216916fbbf3eb632a9d9d. Task-number: PYSIDE-571 Change-Id: Ide49ef2c9f99335b5019daea7d27cd1d86e896a4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: replace wrong license headerCristián Maureira-Fredes2020-01-301-26/+28
| | | | | | | | By mistake some examples were released under LGPL, but Qt for Python examples are distributed with the BSD license. Change-Id: Idbbf2067f2321d14cb3276ea36fe13f6551498a6 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Add example for Threads and SignalsAlejandro Gutierrez2020-01-271-0/+98
| | | | | | | | | The goal of this file is to provide an example for signals being emitted from one thread to another. Task-number: PYSIDE-841 Change-Id: If494fbfef6d8c46b37d5b750163c909bc6c55c7a 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-0614-17/+16
| | | | | Change-Id: I85216bcfc23161b832ecb675ea58f33e67004fe9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: remove semi-colons from filesCristián Maureira-Fredes2020-01-061-25/+25
| | | | | | Change-Id: Iba52405551440659d60b11b3dfb9078d6066cec6 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add .pyproject files for each exampleCristián Maureira-Fredes2019-09-2727-0/+90
| | | | | Change-Id: I4dec66067aa2b0cc50d1ac3226537e4f09006132 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-06-192-20/+27
|\ | | | | | | Change-Id: I42955abfeb1fe8b7c6443a9b334154984286b9cc
| * Examples: Use QSaveFileFriedemann Kleint2019-06-122-20/+27
| | | | | | | | | | | | | | | | | | QSaveFile should preferably used for writing out files from editor applications to ensure files are properly written and existing files are not overwritten should writing fail. Change-Id: I5d9b98c168649d23f5ee31171b1729fd230dc8de Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-05-061-94/+131
|\| | | | | | | Change-Id: Ia87a2e46bb051f1cccf3b7ba988aeb5eb32c0f0e
| * Regenerate all example forms using the python-extended uic of 5.14Friedemann Kleint2019-04-261-94/+131
| | | | | | | | | | | | Task-number: PYSIDE-797 Change-Id: I69904a6e104fc40ddb6e60e99761ffc30bcf717a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Regenerate all example forms using the python-extended rcc of 5.14Friedemann Kleint2019-04-2612-15200/+14742
| | | | | | | | | | | | Task-number: PYSIDE-855 Change-Id: Ib6f3989f1303f59c095cb12060f45388f0500b41 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-04-021-3/+4
|\| | | | | | | Change-Id: I7fc1857f15ccf5d9667dd6d6adb8208c775c6722
| * Examples: classwizard import __future__ firstCristian Maureira-Fredes2019-03-281-1/+1
| | | | | | | | | | Change-Id: Iee3070f59472ee6a75495304f841ba012c90e873 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix classwizard example (str -> QByteArray)Cristian Maureira-Fredes2019-03-271-3/+4
| | | | | | | | | | Change-Id: I0c82e2d5a8fb431f55dd9d54ecaab48d8f40adb6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-03-251-1/+1
|\| | | | | | | Change-Id: I799b9e4784722de40e53922f7355ab801b924833
| * Fix standarddialog QFontDialog.getFont (returns)Cristian Maureira-Fredes2019-03-211-1/+1
| | | | | | | | | | | | Change-Id: I3b5420963445987f407d4332d0823e2790210f0a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-03-196-6/+0
|\| | | | | | | Change-Id: I137dc1d4b7dc73ee8ad4cff2eb031e2aaead2644
| * Remove unnecessary show() in tutoralCristián Maureira-Fredes2019-03-146-6/+0
| | | | | | | | | | Change-Id: I0a72f484fb5591f8c1d47fa534407c8e15cdb396 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add codeeditor exampleCristian Maureira-Fredes2019-01-302-0/+193
|/ | | | | | | Based on Qt's Code Editor example Change-Id: I17ba0dfbafcda5a599cd2ef051e842cdd4b6e305 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Change example scripts permissions to 644Cristian Maureira-Fredes2018-12-1253-53/+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>
* syntaxhighlighter example: Fix upFriedemann Kleint2018-12-111-73/+47
| | | | | | | | | | | - Use a QTextStream to read lines correctly. - Base it on QSyntaxHighlighter instead of hooking into the text document. - Streamline code and use standard keybindings - Fix imports. Change-Id: I2bd9571c85bb3cca1e90cd9cb441dfe35d26b685 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Remove semicolon from examplesCristian Maureira-Fredes2018-06-186-13/+13
| | | | | | Task-number: PYSIDE-712 Change-Id: Ib91e4fec88bdb7146e54c285c7f4da60deecb6cf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Adapt examples to proper QByteArray constructorCristian Maureira-Fredes2018-06-056-65/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | After correcting the QByteArray behavior, the available constructors are constraint to bytes, bytearrays, and others QByteArrays. The modified lines are methods that use the modified argument as a QByteArray (interally), that is why we now we transform them: "test value" -> b"test value" Bytes are Python 2 and 3 compatible, so it does not affect the version. The only different change is inside `schema.py` where a change was needed to encode a QByteArray into utf-8. Since this is outside our automated test, I manually test it with Python 2.7.15 and 3.6.3 on Linux. Task-number: PYSIDE-669 Change-Id: I8c12533b482150f4aee3d813dc127eb6b819549b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>