aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Port the colorpaletteclient exampleFriedemann Kleint2024-03-0737-0/+2976
| | | | | | Task-number: PYSIDE-2497 Change-Id: Ic57785fa221afa7d3d5cd5f3550c5a6e2d38f08b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* filesystemexplorer example: Remove import PySide6Friedemann Kleint2024-03-041-3/+2
| | | | | | | | | | This is bad practice which slows down the application startup. Task-number: PYSIDE-2576 Task-number: QTBUG-119785 Pick-to: 6.6 Change-Id: I761bceab9c2a3071a9a63c347df08c75fffec84f Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Adapt to renaming of namespace QAudio->QtAudioFriedemann Kleint2024-02-282-19/+19
| | | | | | | | | | | - Adapt the examples. - Create an alias into the module. - Add a hack to the signal manager for signals which maintain the old string-based signature. Task-number: PYSIDE-2497 Change-Id: I9db5e59851a2cb9161fdcecf87e78d980eda2045 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Adapt to QtGraphs changed APIFriedemann Kleint2024-02-288-66/+60
| | | | | | | | Task-number: QTBUG-114091 Task-number: PYSIDE-2497 Change-Id: I62b6c50ea4cafd240ef75b2814849821f4eb2c3b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Examples: adapt to consider permission API on macOSShyamnath Premnadh2024-02-265-11/+41
| | | | | | | | | | - When Python is run in interpreter mode, we print and exist with a message. Pick-to: 6.5 6.6 Task-number: PYSIDE-2468 Change-Id: I79ce06eb2b96418fc2f84c11cccbd2e72207f3c1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move QtGraphs examples aroundFriedemann Kleint2024-02-2631-0/+0
| | | | | | | Match the structure in the Qt repo. Change-Id: I372ef102165ce9bbe3cef03f915ad44b82f1fc44 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Port the simplerhiwidget exampleFriedemann Kleint2024-02-2612-7/+406
| | | | | | | | Task-number: QTBUG-113331 Task-number: PYSIDE-2497 Task-number: PYSIDE-2206 Change-Id: I69b69a761eb4485b8a0f6c14d92065b0699336ea Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix exit crashes of the audiooutput exampleFriedemann Kleint2024-02-211-2/+9
| | | | | | | | | Make sure it stops in closeEvent(). Pick-to: 6.6 6.5 6.2 Task-number: PYSIDE-2206 Change-Id: I749e82b6bd689b8c608c3438fe3480581e82bf14 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: Simplify minimal_asyncioAdrian Herrmann2024-02-161-24/+2
| | | | | | | | | | | | For historical reasons, the minimal asyncio example was unnecessarily complicated (as it tried to follow the trio example's approach of an AsyncHelper class). Simplify the code to make it more straightforward and understandable. Pick-to: 6.6 Task-number: PYSIDE-769 Change-Id: I376b73356f7e46f640db482a9e149f1a6fa54dd6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Qt Linguist example: Enable building translations with pyside6-projectFriedemann Kleint2024-02-121-2/+2
| | | | | | | | | Remove the use of the "translations" directory and make it a resource prefix instead. Adapt the tutorial accordingly. Pick-to: 6.6 6.5 Change-Id: I9b7da17b4aac6a1470f5105b33a6267c78e1c26b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Improve the samplebinding build instructions for WindowsFriedemann Kleint2024-02-121-1/+1
| | | | | | | | | Add CMAKE_C_COMPILER definition to prevent CMake from falling back to Clang. Pick-to: 6.6 6.5 Change-Id: I755d6c99f84293c680e56b7cfa7af3f7fb0dd934 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Brush up the usingmodel exampleFriedemann Kleint2024-02-072-32/+28
| | | | | | | | | | | | | | | Although not any more in Qt, it nicely shows the use of roles and delegates in QML. - Use a little data class for Person. - Change the custom role name away from "modelData" which is now a reserved name and caused it to no longer work. - Use a modern decorator. Pick-to: 6.6 6.5 Task-number: PYSIDE-2206 Change-Id: I3a3c1ad96f3a7ee89ada839236b45f461af149c7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Documentation: Link the Qt Linguist and GNU gettext examplesFriedemann Kleint2024-02-012-0/+14
| | | | | | | Pick-to: 6.6 Task-number: PYSIDE-1112 Change-Id: Ica9c369f488afae6206b30e17d3743e0f3772642 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Adapt to glue code to namespaced Qt buildsFriedemann Kleint2024-01-302-2/+2
| | | | | | Task-number: PYSIDE-2590 Change-Id: I7269b0f1c1758a9d26579267fc0b423c6a0422ac Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* examples: fix flake8 issues and add exceptionsCristiรกn Maureira-Fredes2024-01-2587-130/+131
| | | | | | | | | | Exception for: - qApp and tr not being directly imported: F821 - *rc and qml modules being imported but not used: F401 Pick-to: 6.6 6.5 6.2 Change-Id: I5e40f3f54c1721ef3dc5d7f1e87d5fd8ec771b8e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Filesystemexplorer-example: port v2Dennis Oberst2024-01-2320-451/+834
| | | | | | | | | | Since we're touching the example: improve the visualization of files inside the tree-view and provide a minimum width and height. Task-number: PYSIDE-2576 Task-number: QTBUG-119785 Change-Id: I47c6d3eb02436a9ab4213e9b8195b32eaaf37573 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Add Android tagShyamnath Premnadh2024-01-1214-0/+28
| | | | | | | | | | | | | | | - Examples that work on Android are tagged Android. - Clicking the tag lists all PySide6 examples supported in Android. - sphinx-tags package added to add blog like tags to examples. [ChangeLog][PySide6] Examples supported on Android are tagged `Android` in documentation Pick-to: 6.6 Task-number: PYSIDE-1612 Change-Id: Ic4ea2c63756d060aeea85b0088da9ae248eda24e Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add QLatin1StringFriedemann Kleint2024-01-081-0/+2
| | | | | | | | | It is needed For the QIcon::ThemeIcon fields. Task-number: PYSIDE-2497 Task-number: PYSIDE-2537 Change-Id: I11d94c150dfa614797038e56cd37128bf3e88cff Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: update sql/books iconsCristiรกn Maureira-Fredes2024-01-056-60/+97
| | | | | | | Change-Id: I4fe6e62fa643b1e073eea8ec49f3864abc810108 Fixes: PYSIDE-2521 Pick-to: 6.6 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* QtAsyncio: Add QtAsyncio.run() functionAdrian Herrmann2023-12-202-7/+4
| | | | | | | | | | | | | | | | | Add a QtAsyncio.run() function as the new recommended method to launch QtAsyncio programs. This abstracts the event loop policy and reduces the API to one single call. Additionally, this will allow to transparently replace the event loop policy with a loop factory when event loop policies are removed in Python 3.15 following their deprecation in 3.12. More information: https://discuss.python.org/t/removing-the-asyncio-policy-system-asyncio-set-event-loop-policy-in-python-3-15/37553 Pick-to: 6.6 Task-number: PYSIDE-769 Change-Id: I59d7eeb81debe92315351995f041caead4f51d8b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QtAsyncio: Catch keyboard interruptsAdrian Herrmann2023-12-192-6/+0
| | | | | | | | | | | | | Catch keyboard interrupts by catching the SIGINT signal and handling it with the default handler. Register the handler with the QAsyncioEventLoopPolicy so that this is always done when using QtAsyncio. Pick-to: 6.6 Task-number: PYSIDE-769 Change-Id: I7b35367a50ab03eb014faabf6b6a3b21a6a3cd6c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix a number of flake8 errors (part 3)Adrian Herrmann2023-12-0614-39/+17
| | | | | | | | | | Fix unused variable errors and other miscellaneous errors not included in parts 1 and 2. Pick-to: 6.6 Change-Id: Ifb4336cd4ecdd62928042e1011d4430a461efc7c Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix a number of flake8 errors (part 2)Adrian Herrmann2023-12-0614-19/+15
| | | | | | | | Import changes, i.e., removed or added imports. Pick-to: 6.6 Change-Id: Iadfa8f77846d8ffef0aeea9fd1a6e7e9c4df5106 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix a number of flake8 errors (part 1)Adrian Herrmann2023-12-06104-698/+673
| | | | | | | | | First batch, including low-hanging fruit like Alignments, whitespaces, line length, indents, etc. Pick-to: 6.6 Change-Id: I55966876077f7fddfdc82cbe376677af9995f329 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix example quick3d/proceduraltextureFriedemann Kleint2023-12-061-1/+1
| | | | | | | | | | | Update QML file from C++, fixing error: ProceduralTextureModule/Main.qml:85:26: ArrayBuffer is not a type Pick-to: 6.6 Task-number: PYSIDE-2206 Change-Id: Ib2c2c7429acd251e9b28c78283c0ef50a077244b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* PySide Examples: Add Contactslist exampleShyamnath Premnadh2023-12-0412-0/+496
| | | | | | | | | - Also works for Android Pick-to: 6.5 6.6 Task-number: PYSIDE-2206 Change-Id: Ib41b004a343c64a355187c9ef1780a8da4bd0553 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Fix some flake warningsFriedemann Kleint2023-11-2870-112/+135
| | | | | | | | Mostly spacing related. Pick-to: 6.6 Change-Id: If0d5b25e1c60b7b216f970d1e57613f00bd04a37 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* doc: Use different titles for async examplesAdrian Herrmann2023-11-242-4/+4
| | | | | | | | | Give the two async examples different titles in documentation so they don't appear with the same name in navigation. Pick-to: 6.6 Change-Id: I342a5b611e3d2b6cc415162c8ce5a0ee9441c8a8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* doc: remove double white spaceCristiรกn Maureira-Fredes2023-11-213-6/+6
| | | | | | Pick-to: 6.6 Change-Id: I68b835bb5fa00d35fe5406deee2acc83c7bac7cb Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Scene Graph Painted Item Example: Prototypically enable QML debuggingFriedemann Kleint2023-11-201-1/+9
| | | | | | | | Task-number: PYSIDE-2206 Pick-to: 6.6 6.5 Change-Id: I8112a1bd5c6020373d11a70a0043ccd1273735de Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Update the clock exampleFriedemann Kleint2023-11-201-32/+48
| | | | | | | | | | | Port qtbase/619ec1a6406a8be7bfa9d96b9e693e7a3323d8dc to our QWindow example. Pick-to: 6.6 6.5 Task-number: QTBUG-118871 Task-number: PYSIDE-2206 Change-Id: Ib8ab8bf6f415b31d1493b3ea21f2c93aca4ed13d Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Add QtQuick3D Procedural texture exampleCristiรกn Maureira-Fredes2023-11-158-0/+350
| | | | | | | | | Pick-to: 6.6 Task-number: PYSIDE-841 Co-authored-by: Dennis Oberst <dennis.oberst@qt.io> Change-Id: I191965e81aa93b812b128ad2045da1ef13f157b5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add rhiwindow exampleFriedemann Kleint2023-11-0215-0/+938
| | | | | | | Pick-to: 6.6 Task-number: QTBUG-113331 Change-Id: I4d775ecaeab5e8692a06d19b9951b139bc3d1051 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* File system explorer example: Improve shortcutsFriedemann Kleint2023-10-251-2/+3
| | | | | | | | Use the standard keys for zoom and the common Ctrl+Q for quit. Pick-to: 6.6 Change-Id: I3659a5a84bc1e46938729710af31c834b8a50ed8 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Browser examples: Some improvementsFriedemann Kleint2023-10-123-3/+13
| | | | | | | | | | - Output the Render process exit code in hex - Add an option for single process mode for trouble shooting Pick-to: 6.6 Change-Id: Ia9c9f7b7879b8a0b763f8bd74ac57c3d3579c06f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* async: Remove unneeded signal from exampleAdrian Herrmann2023-10-101-6/+0
| | | | | | | | | Remove the unneeded done_signal from the eratosthenes asyncio example. Pick-to: 6.6 Task-number: PYSIDE-769 Change-Id: I5cc347ebb265e55afa82d37ce07fa2c6378ce133 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Example Revamp: CameraShyamnath Premnadh2023-10-027-9/+1193
| | | | | | | | | | | | | | - Changes as per e3c0c190136a55634451024cfa3ac8024c74caa3 - New UI for Android as per the corresponding Qt example - Add the new permission API functions to request and check for Android runtime permissions - Update .pyproject file Task-number: PYSIDE-1612 Task-number: PYSIDE-2206 Pick-to: 6.6 Change-Id: I8b9c41c6cd12388addb5a8a4049c1126b62e098b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* async: Revamp asyncio examplesAdrian Herrmann2023-10-024-190/+30
| | | | | | | | | | | | | The "minimal" and "eratosthenes" examples for asyncio have now been thoroughly revamped to use QtAsyncio instead of the previous experimental approach. As it so happens, this results in a significantly more streamlined and readable code. Pick-to: 6.6 Task-number: PYSIDE-769 Change-Id: If9eb2213a2a95b359d2ec3e468027c6b1edf3866 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix animations of the chart themes exampleFriedemann Kleint2023-09-281-12/+2
| | | | | | | | | | Amends 66f7f1fc866dd19aa5a86164d93a7b9a50e07af6. Pick-to: 6.6 6.5 6.5.3 Task-number: PYSIDE-2425 Change-Id: I5cd225de9ae7fbd666d13892cdd8a78b21c9054e Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Example Revamp: Audiosource exampleShyamnath Premnadh2023-09-251-1/+30
| | | | | | | | | | | | - Changes as per e3c0c190136a55634451024cfa3ac8024c74caa3 - Add the new permission API functions to request and check for Android runtime permissions Task-number: PYSIDE-1612 Task-number: PYSIDE-2206 Pick-to: 6.6 Change-Id: Ie1213872775f1570dff7b9a7102fe3494996b9a9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add multiwindow functionality from the C++ exampleFriedemann Kleint2023-09-195-13/+110
| | | | | | | | Pick-to: 6.6 Task-number: PYSIDE-2460 Task-number: PYSIDE-2206 Change-Id: I6644e098c15885271bd4bc1188ae44e6c984b369 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Examples: Split the hellogl2 exampleFriedemann Kleint2023-09-196-440/+489
| | | | | | | | | | | | | | | | | | Some small refactoring: shorten lines, use super() and move shader code to constants. Refactor the transparent option handling to be in line with the C++ example. Call the OpenGL cleanup from hideEvent() instead of QOpenGLContext::aboutToBeDestroyed() since the signal is emitted from the destructor and thus has no effect for Python. Pick-to: 6.6 Task-number: PYSIDE-2460 Task-number: PYSIDE-2206 Change-Id: I5d140db6e04baf88d2ac867d809c6cff9eb740b5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Document viewer example: Adapt to revised API of QPdfPageSelector (6.6)Friedemann Kleint2023-09-131-4/+3
| | | | | | | | | | | Adapt to qtwebengine/8b20e0636a89dc3e6b06d174286ee16aa427887a. Complements 4ed257c5e476ab82b1e66c15574a4ebb016d179e. Task-number: PYSIDE-2206 Task-number: QTBUG-116987 Change-Id: I0092fc5f957fc6d0902cd2386ff47c358ff695d6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* PySide Examples: Adapt HeartRateGameShyamnath Premnadh2023-09-083-8/+46
| | | | | | | | | | - Adapt to consider requestPermission() and checkPermission() Pick-to: 6.5 Task-number: PYSIDE-2206 Task-number: PYSIDE-1612 Change-Id: Ib4a0beb4db971b356cc6705d3fc8d95ad6b1fa17 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken6: Replace options related to nb_zero by nb_boolFriedemann Kleint2023-09-062-2/+2
| | | | | | | | | | | | | | nb_zero is Python 2 terminology. Rename the related functions and use new options. [ChangeLog][shiboken6] The command line options --use-operator-bool-as-nb_nonzero and --use-isnull-as-nb_nonzero have been replaced by --use-operator-bool-as-nb-bool and --use-isnull-as-nb-bool, respectivily to match Python 3 terminology. The old options continue to work. Change-Id: I1201f4b15e021c8df96740149c20fa1478c12ae1 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* charts: fix chart theme exampleCristiรกn Maureira-Fredes2023-08-181-20/+2
| | | | | | | | | | | | After the proper implementation of Python Enums, there was some code dealing with the Enum value to set the proper enum name that is obsolete. Pick-to: 6.5 Fixes: PYSIDE-2425 Change-Id: I0ee778d09ac3b51432b6ab03e50e31e1a85bfb69 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* examples: Fix Tetrix line-removing bugXU, KE2023-08-071-1/+1
| | | | | | | | | | | | | | | | | When Tetrix example runs, a full line of blocks will remove itself and any other lines below. The root cause is the code only removes the lowest line as it would be the full line but a full line can be at not only the bottom. And this lead to a continuous full-line-finding and removes the lowest line again and again until the full line is removed. This fix introduced a minor fix by changing the index of traversing through the lines to be moved down. This modification allows removing a line that is not at the bottom and fixes the bug. Fixes: PYSIDE-2412 Pick-to: 6.5 Change-Id: I7b23bc82b9baac720152a1d93e242df29b82f768 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Multimedia screen capture example: Add window captureFriedemann Kleint2023-08-046-53/+171
| | | | | | | | | | Port from qtmultimedia/3edff8e367b9060dd138a2b67cb87d2246a4a3e6. Task-number: PYSIDE-2206 Change-Id: Ia702faf47946a0f656b1546b205dfb442cf2f56a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Add the Qt Graphs widgetgallery exampleFriedemann Kleint2023-07-2829-0/+2912
| | | | | | | | | It is a copy of the QtDataVisualization graph gallery example adapted to Qt Graphs. Task-number: PYSIDE-2206 Change-Id: I908312b15324dd030f5610508f13299921fafc26 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* DOM XBEL example: Combine create_actions() into create_menus()Edward Welbourne2023-07-171-21/+10
| | | | | | | | | | | This is to match the C++; the MainWindow doesn't need the QAction instances as member variables, they can perfectly well be simply created and used in the course of hooking them up to menus. Task-number: QTBUG-111228 Pick-to: 6.5 Change-Id: Ic6b936e4b6ccfd57ba22a7c738c36089547cf764 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>