aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* examples: Fix widgets/screenshot.pyHEADdevChristian Tismer8 hours1-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>
* examples: Fix conversion omission in settingseditor.pyChristian Tismer29 hours1-1/+1
| | | | | | | | | | | | A list entry was used as-is in a join expression without converting it to a string. This was found while testing examples with PyPy. Pick-to: 6.2 Task-number: PYSIDE-535 Change-Id: I4fa2f1cc10f3eb8027966a1946a940458d1526d4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: Fix f-string in corelib/mimetypesbrowser.pyChristian Tismer29 hours1-1/+1
| | | | | | | | | This was found while testing the examples with PyPy. Pick-to: 6.2 Task-number: PYSIDE-535 Change-Id: I75296f314c4411427cfd8bc509f242cd754dde91 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add documentation to the plot exampleFriedemann Kleint3 days2-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 Kleint7 days8-33/+57
| | | | | | | | | 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 Premnadh10 days5-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>
* AudioSource Example + Binding for QAudioFormat.normalizedSampleValue(data: ↵Shyamnath Premnadh2021-12-284-0/+256
| | | | | | | | | | | | | | | | | | | | bytes) In order to make the AudioSource example available in Python, the following functions were properly exposed to Python. - normalizedSampleSource(const void* data) const in QAudioFormat Previously, Shiboken took care of exposing these functions on its own. The fix here is to use PyBuffer as the counterpart for const char* in the Python side. The patch also consists of the working AudioSource example. Currently only the Push Mode works. Inorder to make the pull mode work, the function writeData(const char* data, qint64 len) should be properly exposed from C++ to Python through typestem, without code duplication. Task-number: PYSIDE-841 Task-number: PYSIDE-1743 Pick-to: 6.2 Change-Id: I1cd2c28136836c9bdf1021693f74e59eb98f390b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add mimetypesexampleShyamnath Premnadh2021-12-216-0/+446
| | | | | | | | | - port of corelib/mimetypes/mimetypebrowser example from Qt6 Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: Ib2f1637935662f969b264315bbf8ba036bb9420b 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-1517-3553/+3553
| | | | | | Pick-to: 6.2 Change-Id: I6e92728d6208aad0c0d8871ef362da30a61e358e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* samplebinding example: Remove primitive type definitionsFriedemann Kleint2021-12-102-11/+5
| | | | | | | | Those types are now built-in. Task-number: PYSIDE-1660 Change-Id: Id09a44ae5d216db8abee034a6b136c3c8bab3b2d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Update example documentation of samplebinding / scriptableapplicationFriedemann Kleint2021-12-104-21/+43
| | | | | | | | Update versions and build information. Pick-to: 6.2 Change-Id: I82eb4b36e2357145f89bb640f2674deda6fe2253 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Document the scriptableapplication, samplebinding examplesFriedemann Kleint2021-12-084-166/+233
| | | | | | | | | | Add a dummy .pyproject file into the doc directory for the example gallery script to collect it. Convert the .md files to .rst files for the documentation. Pick-to: 6.2 Change-Id: I87ea5b980d3d2177a7851f71462ca0b0bd0eba7e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix customgeometry.pyproject fileFriedemann Kleint2021-11-291-1/+1
| | | | | | | | | | | | | | | It caused: File "tools/example_gallery/main.py", line 298, in <module> content_f += get_code_tabs(pyproject["files"], out_f) KeyError: 'files' Amends b9ec49942b3ad53343317e631320c58e59736c22. As a drive-by, handle the error in the gallery tool. Pick-to: 6.2 Change-Id: Ideca9ccb72021780cf8ae7b3f2204733cc2f5e4f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QtQuick3D moduleCristián Maureira-Fredes2021-11-2915-0/+1475
| | | | | | | | | | | | Adding the module that contains a few C++ classes. Adding the 'intro' example. Adding the 'customgeometry' example as well. Pick-to: 6.2 Fixes: PYSIDE-1708 Change-Id: I0681f087e74c13c024bb1dfa8de545b30f95d7d8 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move from distutils to setuptoolsCristián Maureira-Fredes2021-11-261-2/+2
| | | | | | | | | | This is motivated by the deprecation of distutils, and removal in future versions https://github.com/pypa/packaging-problems/issues/127 Pick-to: 6.2 Change-Id: I16448b69f98df6dc1d9a904b69eb69ed5f1093f5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* 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>
* Brush up the openglunderqml exampleFriedemann Kleint2021-11-223-11/+8
| | | | | | | | | | | | | | | | - Use suffix-less RHI constants (see 23dbe3d6e0d3338812ad9f614028a6fdc5a54090). - Remove unneeded assignments - Add slot decorator - Streamline code Amends b31f0c37bdc78e939db2dfe3bd876eba47137a5c. Pick-to: 6.2 Fixes: PYSIDE-1716 Task-number: PYSIDE-1034 Change-Id: Ib34be3642d3c2b5f3582889bdc5f0d8d7cebe007 Reviewed-by: Christian Tismer <tismer@stackless.com>
* scriptable: make it work by default on macOS, tooChristian Tismer2021-11-221-1/+1
| | | | | | | | | | | | | | | Some platforms like Homebrew's macOS name the Python interpreter "python3", while others use "python" as the default name. In any case, it is correct to use the Python 3 version as default, because Python 2 is deprecated. The default now tries "python3" first and falls back to "python". Task-number: PYSIDE-1710 Change-Id: I8850b2c157d219e7785177f41425dca1c2144f99 Pick-to: 6.2 5.15 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 the 'default' example of the QML reference examplesFriedemann Kleint2021-11-106-0/+330
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: I465f9e92b5fca2b6e7e261d1976082e834af528b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the 'methods' example of the QML reference examplesFriedemann Kleint2021-11-106-0/+308
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: I99a592e6a9c347c46dd9bb86a9e925d0f70c34c6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the 'coercion' example of the QML reference examplesFriedemann Kleint2021-11-107-1/+337
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: Iff14a58f065070ef3ffe409bb1516bd4ed30dac7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@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>
* PySide6: Fix documentation of the properties QML reference exampleFriedemann Kleint2021-11-051-2/+2
| | | | | | | | | | | | | Fix warnings: sources/pyside6/doc/examples/example_declarative_referenceexamples_properties.rst:17: WARNING: Pygments lexer name 'javascript:' is not known sources/pyside6/doc/examples/example_declarative_referenceexamples_properties.rst:36: WARNING: Pygments lexer name 'python:' is not k Amends e057d9f4cbfd97e5fc0bdec564f63fabe5b50189. Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: I358238f5152c1980c6c12a80b3caf76304f29e8e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add the 'properties' example of the QML reference examplesFriedemann Kleint2021-11-027-0/+381
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: I6565bdbbc4ea401c027f6aab41598df48c779799 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix invalid drawing of horizontal lines in the Qt Designer taskmenu exampleElisabeth Ortega2021-10-291-2/+2
| | | | | | | | | | | In the TicTacToe game, consecutive states in different rows did incorrectly draw an horizontal line. Fix by letting the loop operate in steps of 3 as in the C++ example. Pick-to: 6.2 Fixes: PYSIDE-1701 Change-Id: I325ece1d262510167d1182636814ff8d7aa85a3d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Relational table model exampleElisabeth Ortega2021-10-222-0/+170
| | | | | | | | | Translated relational table model example from C++ using population data instead employee data Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: I493a7106275609edefdc4e140c9c9cc667a9c10f 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>
* Add the btscanner exampleFriedemann Kleint2021-10-209-0/+640
| | | | | | | | Pick-to: 6.2 Task-number: PYSIDE-841 Task-number: PYSIDE-1690 Change-Id: I6b3d774b4c136af2b71251e0b8aafa6f12ba39a2 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>
* Port the rendercontrol_opengl/rendercontrol_opengl exampleFriedemann Kleint2021-10-116-0/+807
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: I432498ff85d346def9604a551fddddb0a0939b25 Reviewed-by: Christian Tismer <tismer@stackless.com>
* New Areachart exampleElisabeth Ortega2021-10-104-0/+115
| | | | | | | | | Areachart example translation from C++ to Python Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: I84af72428279efd6544667d40dc5908e0a1a463f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* New Barchart exampleElisabeth Ortega2021-10-104-0/+117
| | | | | | | | | Barchart example translation from C++ to Python Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: Ia705295f6f8c59ec9b94bc394cc1d45f35554bdf Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the 'adding' example of the QML reference examplesFriedemann Kleint2021-10-075-0/+265
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: I274039d0642a84f526008c8ecc27f2727c84a3cd Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix Qt Quick Control2 example to workFriedemann Kleint2021-09-291-2/+2
| | | | | | | | Use QUrl.fromLocalFile() for the QML file. Pick-to: 6.2 6.2.0 Change-Id: I9433e3ae5c26e9db24d2b8ee4984e948fefa9aef Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* 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>
* examples: add QAbstractListModel/QMLJimmy Girardet2021-09-217-0/+521
| | | | | | | | | | | Interactive example to add, remove and move elements inside a ListView (QML) from a QAbstractListModel (Python). A screenshot is included. Task-number: PYSIDE-841 Change-Id: I1c4d7868860c7482930fbb729cb4c2b503c01d88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: Add QtDataVisualization SurfaceCristian Maureira-Fredes2021-09-216-0/+520
| | | | | | Task-number: PYSIDE-841 Change-Id: Ia98aab49cff5fb86078b547a99b33a4a0bf8790e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: Add OpenGL under Qml exampleCristian Maureira-Fredes2021-09-217-0/+424
| | | | | | | | | This is example is based on the Qt's scene graph example that uses and OpenGL animation inside Qml code. Fixes: PYSIDE-1034 Change-Id: I012818d81d757571a711fcea68df51fa566ae5f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Add the markdowneditor exampleFriedemann Kleint2021-09-2116-0/+3325
| | | | | | | Task-number: PYSIDE-1663 Task-number: PYSIDE-841 Change-Id: I921008a51c074ee01a937df309573067f2272f16 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix Qt Quick painteditem example to run from a different directoryFriedemann Kleint2021-09-171-2/+4
| | | | | | | | Use the Path mechanism to resolve the QML file. Task-number: PYSIDE-1662 Change-Id: I2d6cce02063fab6746d2cdbc7c8c8701fad7e937 Reviewed-by: Christian Tismer <tismer@stackless.com>