aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Fix Qt Quick painteditem example to workFriedemann Kleint2021-09-172-2/+2
| | | | | | | | | | | | | | | - Fix the rightAligned property setter to have the same name as the getter - Fix the anchor property of the delegate Fixes warnings examples/quick/painteditem/main.qml:102:TypeError: 'NoneType' object is not callable examples/quick/painteditem/main.qml:65: TypeError: Cannot read property 'right' of null Pick-to: 6.1 Fixes: PYSIDE-1662 Change-Id: Iebd7a9632954fcc2b48e8a56f6e1c20d62b34468 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Define SbkObjectType to be a PyTypeObjectFriedemann Kleint2021-09-111-1/+1
| | | | | | | | | | | | | | | SbkObjectType was a struct embedding a PyTypeObject after fec1611e9f42c1f0a13eb33474df2ed8ee480842. Remove that and make the types equvivalent, which allows for removing many reinterpret_casts. SbkObjectType is left as a typedef for client code snippets. [ChangeLog][shiboken6] SbkObjectType is now a typedef for PyTypeObject. Task-number: PYSIDE-535 Change-Id: I44812311ccbbe0988c38e34c47d16f6874f8d1cf Reviewed-by: Christian Tismer <tismer@stackless.com>
* doc: improve tutorials and stylingCristián Maureira-Fredes2021-09-092-1/+1
| | | | | | | | | | | | | - Creating screenshots for tutorials. - Add gallery style for tutorials. - Add corporate Icons to the frontpage. - tools: Reduce example long names in the gallery. - videos: new order using panels - Add tutorial about "Why Qt for Python" Change-Id: I3ba50f74998399a47b4a34c1de029f3b746aa1e2 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* PySide6: Fix simplebrowser to workFriedemann Kleint2021-07-291-1/+1
| | | | | | | Remove deprecated API. Change-Id: I7947554bfc582585f93973f25678b570f80c9f6a Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove signature loader completely from physical FSChristian Tismer2021-07-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This proposal was discussed. It was also tested with Nuitka and cx_freeze. [ChangeLog][shiboken6] Python support files are now always embedded. There is no longer a physical copy installed in the FS. Reasoning is: We always had the signature module in real Python files and also as an embedded ZIP file. With the solution to PYSIDE-1621 we suddenly had a way to avoid accessing the file system completely. The remaining question is: Why should we keep the files in the installation at all? Long time ago, it was said that the source files were needed to see tracebacks. But tracebacks are visible the same way, regardless if the files exist as physical files or only in memory. The error messages will be as verbose as always. Personally, I see it more as a drawback, because parts of our application become vulnerable by external manipulation. By the complete virtualization, the system is as self-contained as a binary executable. Task-number: PYSIDE-1621 Change-Id: I821545fb5d52465b69bb2c172bdfb43894ac2109 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* qml: remove version numbers from importsCristián Maureira-Fredes2021-07-2121-34/+34
| | | | | | | | | | | In Qt6 the latest version is used by default. Task-number: QTBUG-82922 Task-number: PYSIDE-841 Change-Id: I71ce9caf58db24b47736b977b461324788b93423 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Keith Kyzivat <keith.kyzivat@qt.io>
* qml: replace context properties and code updatesCristián Maureira-Fredes2021-07-2119-479/+442
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the qml code in the repository was outdated, and followed bad practices, like context properties. Complementary, after the major updates for Qt6 most of the code was not relying on the new ways of register types (singletons, and using the decorator QmlElement). Drop the context property usage in the following examples: - signals/qmltopy1 - signals/qmltopy2 - signals/pytoqml2 - usingmodel - quickcontrols2/gallery - textproperties Additionally: - all the tests related to context properties - tutorials/qmlapp - tutorials/qmlsqlintegration - Removing 'scrolling' example - Fixing some flake8 warnings Change-Id: I649248c0149876bf2bf94e78e27cef7110f42f1d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Keith Kyzivat <keith.kyzivat@qt.io>
* examples: port string and object list modelsCristián Maureira-Fredes2021-07-2010-0/+296
| | | | | | | Task-number: PYSIDE-841 Change-Id: Iec9843e0aff8fc02107c7899a0e56f067c5a6936 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Keith Kyzivat <keith.kyzivat@qt.io>
* Add QtNetworkAuthFriedemann Kleint2021-07-126-0/+307
| | | | | | | | | | Ported redditclient example. [ChangeLog][PySide6] The QtNetworkAuth module has been added. Task-number: PYSIDE-1570 Change-Id: I8a057870bf5a59cab227c271c412eb5b9ec4a7b8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add QtDBus moduleCristián Maureira-Fredes2021-07-125-0/+254
| | | | | | | | | | | | | - List Names example ported. - pingpong example ported. [ChangeLog][PySide6] The QtDBus module has been added. Task-number: PYSIDE-1570 Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Change-Id: I8500662fe51754bedf63b7b3b3c3d5ef4890a755 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>
* pathlib: support all cases which are found in the examplesChristian Tismer2021-07-061-1/+1
| | | | | | | | | | | | Wherever possible/useful, os.fspath was removed and the according pathlike modification inserted. This is still not the awaited end of the conversion, but a good step forward. Task-number: PYSIDE-1499 Pick-to: 6.1 Change-Id: I0a22ddeec06ada05dc4a97ed104d06f5f1bbf472 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Add QtWebEngineQuickFriedemann Kleint2021-07-061-2/+2
| | | | | | Task-number: PYSIDE-1570 Change-Id: Ic10a8f29439d5171487dfa5954c3b37be116a2b3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* 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>
* example: add charts dynamic splineCristián Maureira-Fredes2021-07-016-0/+171
| | | | | | | Task-number: PYSIDE-841 Pick-to: 6.1 Change-Id: I4a7ea69a6b1f9aaf190f66c464dcb9e19b20f4c5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Add QSharedMemory exampleCristian Maureira-Fredes2021-06-307-0/+309
| | | | | | Task-number: PYSIDE-1370 Change-Id: Ica8cf855f59bed40b0d2c7ba5dfa1323871337bb Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Re-add QtWebEngine, initial stepFriedemann Kleint2021-06-236-18/+20
| | | | | | | | | | | Remove module QtWebEngine. Move most API from QtWebEngineWidgets to QtWebEngineCore. Adapt imports in tests and examples. The new module QtWebEngineQuick will be added in a follow-up step. This is not functional yet as examples crash in the underlying 6.2 Alpha. Task-number: PYSIDE-1570 Change-Id: I00907e5542404560967e6ae07d102193f1f1e154 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6/QtMultiMedia: Adapt to API recent changesFriedemann Kleint2021-06-234-19/+29
| | | | | | | | | | | | | | | | | | | | | | Build against qtmultimedia/a6e014eb088cb9b7bf55bf87c814e75cd4037dc2: - Re-add QAudioInput, QAudioOutput, qtmultimedia/9fd208f11a218d8a8b07fc525258eea3b3596d62 - Rename QCameraImageCapture to QImageCapture, qtmultimedia/83a031c56b74d68fe6d349f78c48a1681e40374e - Remove QImageEncoderSettings, qtmultimedia/d58d93b8e45b2bf62221b104914df771849c007c - Remove QMediaEncoderSettings, qtmultimedia/9c309ede2feb598908b1476062b79d0d23759bf3 - Changes around QMediaEncoder, qtmultimedia/fde5d6f7cce6118cac4ce7b92cd056225737917f qtmultimedia/994bcb23af8399485ddfdd16d2ba34c20326b432 - Comment out QMediaPlaylist, qtmultimedia/5773f7214c7430a98dea3974c0597cb3ee0ea7f5 Pick-to: 6.1 Change-Id: I9beb96c34ebe6132ad68e3628fcbbf0bc48127ef Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: add screenshots for 3d, axcontainer, chartsCristian Maureira-Fredes2021-06-1634-0/+167
| | | | | | | | | | - Add screenshot - Add one-phrase for each example from doc.qt.io Pick-to: 6.1 Task-number: PYSIDE-841 Change-Id: I72ee7b34d9ecfd595c7e6301fe1576086bc82203 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: add screenshots to more modulesCristian Maureira-Fredes2021-06-1246-7/+203
| | | | | | | | | | | | | | | | | | | | | | | | Adding screenshots and small documentation file to the modules - corelib - datavisualization - external - opengl - quick - sql - uitools - webchannel - webenginewidgets - some widgets - xml Renaming the widgets gallery due to name conflict with the quick controls gallery, and fixing two typos from contextinfo.py and hellogl2.py. Task-number: PYSIDE-841 Pick-to: 6.1 Change-Id: I2705e5d605fa738da0dca906cf6acb4b9d5d3dcd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: add screenshots to widgets and othersCristian Maureira-Fredes2021-06-1261-4/+281
| | | | | | | | | | | | | | | 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>
* PySide6: Adapt to latest changes in QtMultimediaFriedemann Kleint2021-06-091-1/+1
| | | | | | | | | | Rename QCameraInfo/QAudioDeviceInfo to QCamera/AudioDevice, adapting to qtmultimedia/1c4dd0c23c0a7bdefaeecbae491a12f49a6b9ce5. Pick-to: 6.1 Task-number: PYSIDE-1482 Change-Id: I1a2972300aa0a8119e4c90919ed464124a7a6419 Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide6: Adapt to latest changes in QtMultimediaFriedemann Kleint2021-06-071-23/+23
| | | | | | | | | | Rename QAudioOutput to QAudioSink and QAudioInput to QAudioSource, following qtmultimedia/3350275e25c96b391e31d2c9c472b4f0aa58b8f7, qtmultimedia/aa1f073a32147d147e4e9a0fee9dde8ccc30531e. Pick-to: 6.1 Change-Id: I78bca6f8e9c43ef42753b3a81921440afe4ad387 Reviewed-by: Christian Tismer <tismer@stackless.com>
* mdi/application examples: Fix startup without settings fileFriedemann Kleint2021-06-012-2/+2
| | | | | | | | | Pass the proper default value when reading the geometry. Fixes: PYSIDE-1584 Pick-to: 6.1 5.15 Change-Id: I6cff4e9e47b68704d6a75384a84c36268892b409 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Multimedia player example: Add "Open" to toolbarFriedemann Kleint2021-05-281-0/+1
| | | | | | Pick-to: 6.1 Change-Id: I1f6226ece1e12aa5886d1093fee87b5a520416b0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Port the richtext/textedit exampleFriedemann Kleint2021-05-1955-0/+6998
| | | | | | | | | | | The example nicely illustrates QTextEdit, QFileDialog, mime types and other aspects. Pick-to: 6.1 Task-number: PYSIDE-1112 Change-Id: I88358606040dde0701468cba37ee7d12c0acfdb0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Polish the QtWebChannel exampleFriedemann Kleint2021-05-195-24/+26
| | | | | | | | | - Rename according to snake case conventions - Connect sending to QLineEdit.returnPressed Task-number: PYSIDE-1112 Change-Id: Ia0e1b81309985219688739a4cead8a252acd8dcc Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix the multimedia examples to workFriedemann Kleint2021-05-184-318/+425
| | | | | | | | | | | | | | | - Port to qtmultimedia/9a4822037def3b9d48abea8bbfd7ea20fd19849b (wip/qt6). - Add Slot decorators - Rename according to snake case conventions - Connect error signals of player and camera - Use theme icons in player Pick-to: 6.1 Task-number: PYSIDE-1112 Task-number: PYSIDE-1482 Change-Id: Ib79614e56b2b1ad7ea6cd0406efa1d91ce1abdb1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Re-add QtMultimedia/WidgetsFriedemann Kleint2021-05-141-3/+3
| | | | | | | | | | | | | | | | | Fix it to build with qtmultimedia/9a4822037def3b9d48abea8bbfd7ea20fd19849b (wip/qt6). Remove typesystem_multimedia_forward_declarations.xml as the forward declarations of QVideoWidget and QGraphicsVideoItem no longer exist. Fix the tests. Fix the player example to run/crash. Pick-to: 6.1 Task-number: PYSIDE-1482 Change-Id: I340693e3510347f95b55395985bd2b0f294769a1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix further f-string errors in examplesFriedemann Kleint2021-05-142-7/+9
| | | | | | | | | | | | | | | examples/multimedia/camera/camera.py", line 141 pattern = f"{picturesLocation}/pyside6_camera_{dateString}_{:03d}.jpg" SyntaxError f-string: empty expression not allowed examples/external/matplotlib/widget3d/widget3d.py", line 91 self.slider_azim_layout.addWidget(QLabel(f"{self.slider_azim.maximum())) SyntaxError EOL while scanning string literal Amends c5db9d63277201ee58829f7eb0656c534d04c249. Pick-to: 6.1 Change-Id: If6ca3deae03ecb39d58d1eea0ba1802c8b954b57 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix the widget gallery exampleFriedemann Kleint2021-05-141-1/+1
| | | | | | | | | | | Fix error AttributeError 'builtin_function_or_method' object has no attribute 'width' Amends c5db9d63277201ee58829f7eb0656c534d04c249. Task-number: PYSIDE-1112 Change-Id: I5050283a62fea5c389852168284715412cb50260 Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: clean and improve codeCristian Maureira-Fredes2021-05-1321-70/+73
| | | | | | | | | | - 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-129-35/+35
| | | | | | | | | 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 f-stringsCristian Maureira-Fredes2021-05-1216-59/+68
| | | | | Change-Id: I0360f1476af666494c730e4f3c8f4f3c562abc09 Reviewed-by: Christian Tismer <tismer@stackless.com>
* sample binding: Document how to force MSVC in case CMake detects clangFriedemann Kleint2021-05-081-1/+7
| | | | | | | Pick-to: 6.1 6.1.0 Task-number: PYSIDE-1112 Change-Id: I9eefeb12c1609ee0fda4fd0ab160b25f82813f6a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: use exec() instead of exec_()Cristian Maureira-Fredes2021-05-05142-173/+173
| | | | | Change-Id: I07dd4339093be8fcc80e63a2ff0448e998356203 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Image viewer: Display color space in load messageFriedemann Kleint2021-05-041-1/+3
| | | | | | | Port 0a392780c832a968f3501c600b063ab7c62e5c64 from qtbase. Change-Id: I89112fdd7dde283b02b77c802a5276af8b172040 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Examples: Fix some space-related flake warningsFriedemann Kleint2021-04-2971-106/+217
| | | | | | 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-28104-157/+156
| | | | | | Task-number: PYSIDE-1112 Change-Id: Ifcb4da974bdcad7af536404fffdbffc585d3d167 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix the text object exampleFriedemann Kleint2021-04-231-35/+48
| | | | | | | | | | | | The example apparently has never worked. Fix it by using QPyTextObject as a base class and using a different character (as done in qabstracttextdocumentlayout_test.py). Modernize the code and use per-class imports. Task-number: PYSIDE-1112 Change-Id: Iceb6868afe752761820715c1ce68abc77b0a8011 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remaining QGraphicsView examples: Use per-class importsFriedemann Kleint2021-04-233-308/+340
| | | | | | | | | As a drive by, fix breakages caused by removed APIs and oversights of the snake case change and wrap some long lines. Task-number: PYSIDE-1112 Change-Id: I09acdc7bb6f356964c859111ffd4643a97f5bdf6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remaining examples: Use per-class importsFriedemann Kleint2021-04-2319-718/+783
| | | | | | Task-number: PYSIDE-1112 Change-Id: I8534e911959d6eed2ed6d3f7741e99929ff0125e Reviewed-by: Christian Tismer <tismer@stackless.com>