aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Add the spatialaudio audiopanning exampleFriedemann Kleint2022-06-303-0/+211
| | | | | Change-Id: I7ec164baa57da8f846a47daa703eb62f1f0c8be2 Reviewed-by: Christian Tismer <tismer@stackless.com>
* 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>
* Fix various documentation warningsFriedemann Kleint2022-06-223-3/+3
| | | | | | | | | example_datavisualization__surface_numpy.rst:: WARNING: image file not readable: ../surface/doc/surface_mountain.png examples/example_declarative_referenceexamples_extended.rst:1: WARNING: malformed hyperlink target. Pick-to: 6.3 Change-Id: I6c935a79a27b314d4ade12f1c2983aa49aa65259 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QHttpServer::route()/afterRequest()Friedemann Kleint2022-06-222-0/+41
| | | | | | | | | | Complements 77e0363f0257caff13e8fe5fbb9cd1e7f948b066. Add the After Request example. Change-Id: I2d2bcd5993933e9ca133e2f451580633130ae5dc Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* example: add google suggestjaime022022-06-026-0/+192
| | | | | | | | | Ported from C++ Task-number: PYSIDE-841 Pick-to: 6.2 6.3 Change-Id: Ib64218925961f3d0bbd783c5bb9d8365a81e8767 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix enumerations in WebEngine codeFriedemann Kleint2022-05-301-2/+2
| | | | | | Task-number: PYSIDE-1735 Change-Id: Id51ee6dccdf3cc27ee851773f3482f3a6173b364 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use SPDX license identifiersLucie Gérard2022-05-27356-14761/+786
| | | | | | | | | | | 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>
* webenginecore - QtWebEngineProfile setNotificationPresenterShyamnath Premnadh2022-05-187-0/+301
| | | | | | | | | | | - added setNotificationPresenter(...) - added QtWebEngineWidgets Notifications example which uses setNotificationPresenter Task-number: PYSIDE-1912 Pick-to: 6.3 Change-Id: Ib8fdf7879d6e54bcae47dcc89be6bd5a861a8846 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Raise C++ standard to 17 for Qt 6Friedemann Kleint2022-05-132-4/+4
| | | | | | | Pick-to: 6.3 Change-Id: I55bbaeff95bc55aef6a5e13f18a42752c29f61d8 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QtDataVisualization: Add an example for using a numpy array directlyFriedemann Kleint2022-05-054-0/+532
| | | | | | Task-number: PYSIDE-1880 Change-Id: I41a72f1ebcfa5f62826bffe6db670695b248bc7a Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Rename the surface_numpy to surface_model_numpyFriedemann Kleint2022-05-054-0/+0
| | | | | | | Task-number: PYSIDE-1880 Pick-to: 6.3 Change-Id: If7b9946578be4e32fc3b52d360b969e91e642ee3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Refactor the surface examplesFriedemann Kleint2022-04-294-540/+552
| | | | | | | | | | - Introduce a Window class to unclutter main.py - Port to snake case naming Task-number: PYSIDE-1880 Pick-to: 6.2 6.3 Change-Id: I433c48904ccc9adbafceb6d51c86f551e405a10e Reviewed-by: Christian Tismer <tismer@stackless.com>
* Migrate from QLatin1Char to UTF-16 char literalsFriedemann Kleint2022-04-251-1/+2
| | | | | | | | | Preparing for the deprecation of QLatin1Char in 6.4. Task-number: QTBUG-98434 Pick-to: 6.3 6.2 Change-Id: I8bc92aa9f4e6dbfcb12d2025c5a1e760ab4f0d7f Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add a surface example using numpy arraysFriedemann Kleint2022-04-204-0/+568
| | | | | | | | | | Demonstrate how to use numpy arrays in conjunction with a QAbstractTableModel to populate a surface graph. Task-number: PYSIDE-1880 Pick-to: 6.2 6.3 Change-Id: I4eeeea73c1ec1f63278d8d2cd6a740108a644d41 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Surface example: Brush up the codeFriedemann Kleint2022-04-132-5/+8
| | | | | | | Task-number: PYSIDE-1880 Pick-to: 6.2 6.3 Change-Id: I7451a8ffe84e63128daf96adca67add7fcc28862 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Surface example: Fix loading the image from a different pathFriedemann Kleint2022-04-131-1/+3
| | | | | | | | | | Use Pathlib to locate the image file. Task-number: PYSIDE-1880 Pick-to: 6.2 6.3 Change-Id: Idc1c0b6dc3fb1f62edd63e4c6eb61c7d4940387c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add a minimal surface exampleFriedemann Kleint2022-04-132-0/+95
| | | | | | | | | | | This is useful for toying with the module. Pick-to: 6.3 6.2 Task-number: PYSIDE-1880 Task-number: PYSIDE-841 Change-Id: I08f6e920e82a58df23f4b214ae6ec074b22b63e0 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: replace http by httpsCristián Maureira-Fredes2022-04-01263-266/+266
| | | | | | Pick-to: 6.2 Change-Id: Ib53667e03a2dea2afea73a344d5749d37d59c52b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Polish the samplebinding exampleFriedemann Kleint2022-03-215-37/+44
| | | | | | | | | | | - Use a std::shared_ptr for internal storage. - Simplify copy and assignment. - Fix constness of the flavor accessor - Add ostream operator to IceCream Pick-to: 6.2 Change-Id: I814fa14095cbb96ab5642735e16b8b50101d4771 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix scriptableapplication to build on macOS with framework Qt, amendChristian Tismer2022-03-211-2/+3
| | | | | | | | | | | | | | | | The original fix worked with qmake, but the cmake version has a bug. The setting for "qt_core_library_location_dir" was two levels too deep. This fixes the cmake build as-is. The next check-in removes qmake and uses Ninja. Amends {471b05f35a9c57d7fa910cf9f11c7f5fdfbf2a93} Task-number: PYSIDE-623 Change-Id: I288f2e9cd9479843718fa8b498ded51c9c6b140b Pick-to: 6.2 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>
* Add loopback exampleJaime Resano2022-03-185-0/+253
| | | | | | | | | Ported from C++ Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: Ib1a2ab1045d4b8cff6c6a12340b05b8db59f4bad Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the 'grouped' example of the QML reference examplesFriedemann Kleint2022-03-036-0/+381
| | | | | | | | Task-number: PYSIDE-841 Task-number: PYSIDE-1836 Change-Id: Iac93418494911a22c731cecd40464183ad092bb8 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the 'binding' example of the QML reference examplesFriedemann Kleint2022-03-027-0/+479
| | | | | | Task-number: PYSIDE-841 Change-Id: Ie6d991b7c58148aa2963134465aaa156343f0a42 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the 'valuesource' example of the QML reference examplesFriedemann Kleint2022-02-288-1/+466
| | | | | | Task-number: PYSIDE-841 Change-Id: Id7fe04eec3bd6cd734a77691137d1898908b5b45 Reviewed-by: Christian Tismer <tismer@stackless.com>
* QAbstractOAuth - add setModifyParametersFunctionShyamnath Premnadh2022-02-221-3/+20
| | | | | | | | | | - create bindigns for setModifyParametersFunction - reddit example modified to include setModifyParametersFunction() Pick-to: 6.2 Task-number: PYSIDE-1815 Change-Id: If3573df070483f22cc46d9f95f688299e9ece420 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add the 'attached' example of the QML reference examplesFriedemann Kleint2022-02-166-0/+350
| | | | | | | | Task-number: PYSIDE-841 Task-number: PYSIDE-1709 Change-Id: I2b00665eac23fed926915f7b204df6c8cd06e51c Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add the extended' example of the QML reference examplesFriedemann Kleint2022-02-164-0/+231
| | | | | | | | Task-number: PYSIDE-841 Task-number: PYSIDE-1709 Change-Id: If6e52c9f1d8d6d980727143e20de031e750607a4 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PyPySide: Fix locker handling which enables MandelbrotChristian Tismer2022-02-032-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not only the QPainter, but also the QMutexLocker were not correctly modelled after PEP 343 in the examples. Since that is now fixed, we consider the PyPy project not as ready, but good enough to publish it. It also turned out that people have the expectation to use QSignalBlocker in the "as" form: with QSignalBlocker(self.double_spin_box) as blocker: self.double_spin_box.setValue(2.5) https://stackoverflow.com/questions/60384734/how-to-use-qsignalblocker-in-python But that blocker would be None. As a side effect, QMutexLocker, QReadLocker, QWriteLocker and QSignalBlocker were augmented with a default __enter__ implementation that returns the locker instance. [ChangeLog][PySide6] The Mandelbrot example needed context managers for QPainter and QMutexLocker to work in PyPy. Task-number: PYSIDE-535 Pick-to: 6.2 Change-Id: I2a62ca645a4fddcafbf11869f14a538141f32c39 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix the OpenGL textures example for Qt 6Friedemann Kleint2022-02-021-70/+88
| | | | | | | | | | In Qt, the example has been ported to use modern Open GL (shaders). While this can still be done, it is worthwhile to also show the use of QOpenGLVersionFunctionsFactory for legacy Open GL code. Pick-to: 6.2 Change-Id: I5ba434bd5324bde1eec3075689f08c770329ce00 Reviewed-by: Christian Tismer <tismer@stackless.com>
* 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>
* Use Opaque container for OpenGL in the hellogl2 exampleFriedemann Kleint2022-01-271-22/+9
| | | | | | Task-number: PYSIDE-1605 Change-Id: Ieefae548195c19ba9968b48c57d48a8255ed9633 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: Turn most QPainter instances into context managersChristian Tismer2022-01-2626-440/+370
| | | | | | | | | | | | | | | 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-264-8/+5
| | | | | | | | | | | | | 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>
* Port the threadedqopenglwidget exampleFriedemann Kleint2022-01-267-0/+681
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.2 Change-Id: Ia394ab350ab04281e2227dc3af950913f44c6564 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyPySide: handle QPainter correctly with GCChristian Tismer2022-01-2422-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Remove remaining qmlRegisterType()Friedemann Kleint2022-01-219-21/+52
| | | | | | | Pick-to: 6.2 Task-number: PYSIDE-841 Change-Id: I2c3f9b22a3c1fdc6ddbdd7f08db38db613274cfd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@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>
* examples: Fix conversion omission in settingseditor.pyChristian Tismer2022-01-191-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 Tismer2022-01-191-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 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-148-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 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>
* 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>