aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* examples: adapt widgets examplesCristián Maureira-Fredes2022-10-068-67/+145
| | | | | | | | | Fixing issues related to deprecated methods, Enums, and more. Pick-to: 6.3 Change-Id: I07be29601f0ad257f5fcfb0a5bc4891cb7f9648c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add the dropsite exampleFriedemann Kleint2022-09-265-0/+208
| | | | | | | | | It is useful for testing Drag and Drop operations. Pick-to: 6.3 6.2 Task-number: PYSIDE-841 Change-Id: I5cd6fa20542676317223d6acfdc938d286b4347f 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>
* Move further examples around to match the Qt example structureFriedemann Kleint2022-09-2216-0/+0
| | | | | | | | | | | | | - widgets/systray -> widgets/desktop - widgets/digitalclock -> widgets/widgets - widgets/tetrix -> widgets/widgets Amends cf32b66adbfb489cd6e5d5c0bf3f741b59ba204c. Task-number: PYSIDE-841 Change-Id: I132a2334e545ea564a50da0088e0297db4a30437 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: fix unused imports and minor errors in 'widgets'Cristián Maureira-Fredes2022-09-2147-105/+88
| | | | | | Change-Id: I0aad3aefb2f036bf4edc2d0942f007045d605e26 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: add DigitalClock exampleCristián Maureira-Fredes2022-09-194-0/+56
| | | | | | | | | | This is a port of the Digital Clock Example, with a little modification to include seconds. Pick-to: 6.2 6.3 Task-number: PYSIDE-841 Change-Id: I99c36dd4a542f4aa19af2bce90e08bc941a181e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add the character map exampleFriedemann Kleint2022-09-176-0/+376
| | | | | | Task-number: PYSIDE-841 Change-Id: I1aa30657b904d3814c21f16c2404e057e754a960 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Move examples aroundFriedemann Kleint2022-09-1614-573/+0
| | | | | | | | | Change the directory structure to closer match that of Qt. Task-number: PYSIDE-841 Change-Id: I87aca346b6654aafe94dd1fb83c184c182ceb2e6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@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-2421-16/+129
| | | | | | | | | | 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>
* Fix some bitrot in examplesFriedemann Kleint2022-08-191-1/+1
| | | | | | | | | | | | | | | | | | | examples/widgets/graphicsview/elasticnodes/elasticnodes.py", line 132, in __init__ self.setCacheMode(self.DeviceCoordinateCache) AttributeError: 'Node' object has no attribute 'DeviceCoordinateCache' examples/charts/chartthemes/main.py:137: DeprecationWarning: Function: 'QXYSeries.pointsVector() const' is marked as deprecated points = lower_series.pointsVector() examples/charts/chartthemes/main.py:148: DeprecationWarning: Function: 'QChart.axisX(QAbstractSeries * series) const' is marked as deprecated chart.axisX().setRange(0, self.value_count - 1) examples/charts/percentbarchart/percentbarchart.py:46: DeprecationWarning: Function: 'QChart.setAxisX(QAbstractAxis * axis, QAbstractSeries * series)' is marked as deprecated chart.setAxisX(axis, series) Pick-to: 6.3 6.2 Task-number: PYSIDE-841 Change-Id: Ifc7a539f547b5986055a56b98d59ca00c5b51e19 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 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>
* 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>
* 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>
* examples: add license wizardjaime022022-06-297-0/+325
| | | | | | | | | Ported from c++. Pick-to: 6.2 6.3 Task-number: PYSIDE-841 Change-Id: I8cac7256d38a37d2c94967fec4e9349e8b17ec6a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-2799-3986/+255
| | | | | | | | | | | 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-0195-96/+96
| | | | | | Pick-to: 6.2 Change-Id: Ib53667e03a2dea2afea73a344d5749d37d59c52b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add a context manager for override cursorsFriedemann Kleint2022-03-183-31/+26
| | | | | | | | | | [ChangeLog][PySide] A context manager for override cursors has been added. It is now possible to write code like: with QApplication.setOverrideCursor(Qt.WaitCursor):... Change-Id: I443ce82389b48656f21c98df17d97e1b3b3323b5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix examples/widgets/dialogs/classwizard.pyShyamnath Premnadh2022-01-281-1/+1
| | | | | | | | - Changed str to QPixmap Pick-to: 6.2 Change-Id: I591fee0bf254e2c0c5684fc5982d5a3d57695e6d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: Turn most QPainter instances into context managersChristian Tismer2022-01-2622-322/+266
| | | | | | | | | | | | | | | 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>
* Examples: Fix example URLs and documentation warningsFriedemann Kleint2022-01-262-2/+1
| | | | | | | | | | | | | Fix: sources/pyside6/doc/examples/example_corelib__mimetypesbrowser.rst:4: WARNING: Unknown target name: "mime type browser example https://doc.qt.io/qt-6/qtcore-mimetypes-mimetypebrowser-example.html". sources/pyside6/doc/examples/example_multimedia__audiosource.rst:4: WARNING: Unknown target name: "audio source example https://doc-snapshots.qt.io/qt6-dev/qtmultimedia-multimedia-audiosource-example.html". sources/pyside6/doc/examples/example_widgets_tools_regularexpression.rst:4: WARNING: Unknown target name: "qregularexpression example https://doc.qt.io/qt-6/qtwidgets-tools-regularexpression-example.html". sources/pyside6/doc/examples/example_widgets_tools_regularexpression.rst:: WARNING: image file not readable: examples/regularexpression.png Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: I541df87560227d4361823b2948890fb2bf949d8e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* 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-2417-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Fix examples/widgets/richtext/textedit/textedit.pyChristian Tismer2022-01-211-4/+4
| | | | | | | | | | | | | | The function setUnifiedTitleAndToolBarOnMac is called without self prefix. Several imports were missing. This is probably a macOS code path which was untested. Change-Id: Idf96aea668f3822377e4deda74b53b18db150038 Pick-to: 6.2 Task-number: PYSIDE-535 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: Fix state-machine/rogue/rogue.pyChristian Tismer2022-01-211-1/+1
| | | | | | | | | A variable "database" had to be "QFontDatabase". Task-number: PYSIDE-535 Change-Id: I7ccc6c51bdc071cdcfba7cb77fa93773a059f14c Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: Fix widgets/screenshot.pyChristian Tismer2022-01-201-1/+2
| | | | | | | | | | This example contained the ":=" operator which is not allowed in Python 3.7 . Task-number: PYSIDE-535 Pick-to: 6.2 Change-Id: I848c16456807a7a56bdfd80f7cf74e3a86e24e94 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add documentation to the plot exampleFriedemann Kleint2022-01-172-0/+36
| | | | | | | | | Amends bce1bfb3af99aeb24259df34d662e8fcf072d3fd. Task-number: PYSIDE-1605 Task-number: PYSIDE-1776 Change-Id: I28d081d718995e42c1b8fd5341d0ba59c5ed7ca0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Regenerate the example ui filesFriedemann Kleint2022-01-141-5/+12
| | | | | | | | | Remove some star imports. Pick-to: 6.2 Task-number: PYSIDE-1773 Change-Id: I42e3034ae91bdc5779b6ed632fe4f5d234f060b0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Python example for QRegularExpressionShyamnath Premnadh2022-01-115-0/+565
| | | | | | | | | | - Analogous example in C++ - https://doc.qt.io/qt-6/qtwidgets-tools-regularexpression-example.html Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: Id88824d444b2429bc2325832c4c92fb7a2d107f6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add reserve()/capacity() to contiguous opaque containersFriedemann Kleint2022-01-061-0/+1
| | | | | | | | | | | | | Generate bindings for reserve()/capacity() if the container supports it. [ChangeLog][shiboken6] Bindings for reserve()/capacity() were added to contiguous opaque containers. Task-number: PYSIDE-1605 Pick-to: 6.2 Change-Id: I82dd2efc4a1831600aa2fae9427e5d13a67cdd11 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix Tetrix example errorDaniel J Brown2021-12-171-2/+2
| | | | | | | | | | | | | | Previously, the Tetrix example used the old camelCase style method names. The `.setShape()` method in the code was not changed to reflect the swap to snake_case which caused errors. `.setShape()` has now been swapped for `.set_shape()` Pick-to: 6.2 Fixes: PYSIDE-1732 Change-Id: I9876ceb53043cbce2e452326fe8fdb4f47e87e79 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Regenerate the example resource filesFriedemann Kleint2021-12-1513-3065/+3064
| | | | | | Pick-to: 6.2 Change-Id: I6e92728d6208aad0c0d8871ef362da30a61e358e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Brush up the blurpicker exampleFriedemann Kleint2021-11-264-47/+39
| | | | | | | | | | | | | | - Fix the example comment - Use Property decorator - Use leading underscore for private member variables - Streamline the code a bit. Amends ea3851cdaf7f13f62fe9ae23b96750cd70468294. Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: I66843d692a4fa6d0db7da2468ed4358ec48bcd8b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Examples: Fix the directory structure in widgets/effectsFriedemann Kleint2021-11-242-0/+0
| | | | | | | | | Move the lighting example to its own directory. Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: I98b197994eb7f4cd592ce3af81c82d233fab9293 Reviewed-by: Christian Tismer <tismer@stackless.com>
* blurpicker example: Fix syntax error in pyproject fileFriedemann Kleint2021-11-231-1/+1
| | | | | | | | | Amends ea3851cdaf7f13f62fe9ae23b96750cd70468294. Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: Ifb022247e6867ce3e84b1b053e139125e984e4b5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add blurpicker exampleJaime Resano2021-11-2216-0/+308
| | | | | | | | Ported from C++ Change-Id: Id18068e36ecfa26ab0312cfde2de1ba1c0773223 Task-number: PYSIDE-841 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Polish the statemachine examplesFriedemann Kleint2021-11-136-31/+37
| | | | | | | | | | - Remove * imports - Pass signals instead of strings (SIGNAL) - Break lines Pick-to: 6.2 Change-Id: I566f69210821f73dd22d351926a27638e1fc5671 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Examples: Fix copy-paste issue in trafficlight.pyFlorian Bruhin2021-11-131-3/+3
| | | | | | Pick-to: 6.2 Change-Id: I00db0a8e8668678d5e11a1c469ec658d4a9e0a75 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add dragable icons exampleJaime Resano2021-11-107-0/+183
| | | | | | | | | | Ported from c++. Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: Ie7fc583913727ecf1838bc31b79da3ccc293fea2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add screenshot exampleJaime Resano2021-10-224-0/+199
| | | | | | | | | | Ported from C++. Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: I60eea347586a66e69ff83ec3e2b275c053deafca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix spelling take_at -> takeAtJaime Resano2021-10-181-18/+15
| | | | | | | | | Other minor improvements Change-Id: I1a09b6ea813713f53c26f7244f2d913cc73c6c5b Task-number: PYSIDE-841 Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add tab dialog exampleJaime Resano2021-10-174-0/+231
| | | | | | | | | Ported from c++ Change-Id: I3589a66f8335e808bcc81796fa4aa3e2401b5973 Task-number: PYSIDE-841 Pick-to: 6.2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add borderlayout exampleJaime Resano2021-10-174-0/+298
| | | | | | | | | Border layout example ported from C++ to Python Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: I66df4041183ae1eced6fe75d52c21ce381c3d3eb Reviewed-by: Christian Tismer <tismer@stackless.com>
* doc: fix warnings from rst filesCristián Maureira-Fredes2021-09-275-3/+3
| | | | | Change-Id: I97166f7e89c0365f425d1f8b0b840b7ef066d0d7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Add opaque containers for C++ sequence containersFriedemann Kleint2021-09-242-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a class that directly wraps a C++ sequence container, allow for modifying them. For all instantiated containers, generate a special (sequence) type that wraps the C++ container directly. For example, it will be accessible as a QList_int. This is achieved via providing a template for a type private that relies on a conversion traits template for conversion. Only the conversion traits specialization code needs to be generated. Use cases: - Allowing for modifying Fields of such container types (non-owning) - Pass it into functions taking such containers instead of converting back and forth from a PyList (constructed in Python, owning) [ChangeLog][shiboken6] Support for opaque C++ sequence scontainers has been added, allowing to pass a wrapped C++ container directly instead of converting it back and forth from Python sequences. Task-number: PYSIDE-1605 Change-Id: I49d378eb1a0151730d817d5bdd4b71a7c3b5cdda Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add missing resource file for the linguist exampleFriedemann Kleint2021-07-081-0/+5
| | | | | | | | Amends 1cbec5c4a99e80819df54a4dc97091050d55b345. Task-number: PYSIDE-1252 Change-Id: I1c516e6c596191756f37287a802178cc3a32e244 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add a linguist exampleFriedemann Kleint2021-07-074-0/+204
| | | | | | | | Add an example and a tutorial section. Task-number: PYSIDE-1252 Change-Id: Ib0f1399abe9b0eb832c0202f54cb83dfad870d17 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add a gettext exampleFriedemann Kleint2021-07-065-0/+239
| | | | | | | | | Add a small example along with a German translation using gettext. Add a tutorial. Pick-to: 6.1 Change-Id: I254a5a66521ecc2827a5811469d9d21360f99b81 Reviewed-by: Christian Tismer <tismer@stackless.com>