aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* classwizard example: Use and generate super() without parametersFriedemann Kleint2021-04-231-8/+8
| | | | | | | | | | As a drive-by, add a missing comma. Amends 9a9f9fd2528c03df4b0e9dde48026a2181e8a410. Task-number: PYSIDE-1112 Change-Id: I5e7205609b460f56324a8ec193948250e6e38d6b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Brush up the dragdroprobot exampleFriedemann Kleint2021-04-221-64/+70
| | | | | | | | | - Use per class imports - Streamline code Task-number: PYSIDE-1112 Change-Id: I77f00a893b397d1cf73d85bb41038c7c4a73405c Reviewed-by: Christian Tismer <tismer@stackless.com>
* classwizard example: Update documentation and screenshotFriedemann Kleint2021-04-222-1/+1
| | | | | | | | Complements 9a9f9fd2528c03df4b0e9dde48026a2181e8a410. Task-number: PYSIDE-1112 Change-Id: If239fea81f5db505aaaf1fff2cd6d0b8ad7c98f9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rewrite the fetchmore exampleFriedemann Kleint2021-04-221-48/+77
| | | | | | | | | | | | | | | - Use per class imports - Start in root folder so that large directories (/bin/, Windows) are easily reachable - Remove the line edit and navigate by doubleclicking instead since this is more on line with expectations - Use a QPlainTextEdit for logging - Make the log message more informative - Add icons Task-number: PYSIDE-1112 Change-Id: I09663c40331df149cc15735f36f2553236759573 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Cannon tutorial: Brush up codeFriedemann Kleint2021-04-2214-630/+642
| | | | | | | | | | | | - Use per class imports - Remove string-based connections, fixing some errors introduced by the snake case renaming - Add some spacing and indent main - Use math.pi Task-number: PYSIDE-1112 Change-Id: I2171fc9eb27f9926f32648a289df404d390ace43 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Tetrix example: Use per class importsFriedemann Kleint2021-04-211-45/+45
| | | | | | Task-number: PYSIDE-1112 Change-Id: Ib60a1b5ac4cecd6b4152c8264e23a0258047a736 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Brush up the mandelbrot exampleFriedemann Kleint2021-04-151-8/+47
| | | | | | | | | | | | | | | | | | | | | | Port qtbase/0e69349f6f8e9445877ea5b2105973115ad79cf7: The example refines the image by running a number of passes with increasing number of iterations, which is not really visible to the user. Set an informational text string on the generated image which provides this information along with the elapsed time. The idea is to do the same to the corresponding Qt for Python example to have some sort of speed comparison for number crunching. Add a command line option for the number of passes. Make the window a bit larger to accommodate the information. Task-number: PYSIDE-1112 Change-Id: I9313f860947386123166f794b80b541bc057be2c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add new matplotlib example and rearrange dirsSacha Schutz2021-04-156-0/+122
| | | | | | | | | I add a widget showing a 2D gaussian with 2 inputs to adjust mu and sigma Pick-to: 6.0 Task-number: PYSIDE-841 Change-Id: I602b07943ebeb007332bc77c4372ef5a1db20422 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add an editable Json Model exampleSacha Schutz2021-04-153-0/+389
| | | | | | | | | | | This is an adaptation of my code available on https://github.com/dridk/QJsonModel. Due to its success, it may be good to add it into the official documentation. Pick-to: 6.0 Task-number: PYSIDE-841 Change-Id: I5b9acddb684ba27233efa53e6b0e04291aaba46a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add a Paintbrush like exampleSacha Schutz2021-04-152-0/+241
| | | | | | | | | | | | A widget where user can draw on a canvas with different color. It is possible to save and load the canvas into a PNG file. This example teaches the user how to use QPainter outside the paintEvent using a QPixmap. Pick-to: 6.0 Task-number: PYSIDE-841 Change-Id: I8bbab68193894f4f5a6e101fa23fc65e6cb30864 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add downloader example with QNetworkAccessManagerSacha Schutz2021-04-152-0/+218
| | | | | | | | | | | | This widget allows to download a file and show a progress bar. Unlike other example on the internet, bytes are read from the readyRead() method and not from finished(). This makes possible to download large file without consuming memory. Pick-to: 6.0 Task-number: PYSIDE-841 Change-Id: Ic314ef1fbc299be6c3636fcb502b3c532d713cfd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* classwizard example: Update iconsFriedemann Kleint2021-04-129-3611/+2031
| | | | | | | | | Recreate the watermarks with Python code. Use the standard Qt for Python logo and remove the C++ logos. Task-number: PYSIDE-1112 Change-Id: I29679f7f6f4e245d7d29099648fea9678e6706f8 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rewrite the classwizard exampleFriedemann Kleint2021-04-123-276/+501
| | | | | | | | | | | | | | The classwizard created some outdated C++ header and source which is not useful for Qt for Python. Rewrite it to generate a Python class and add a special page allowing for specifying properties and signals of QObjects. Add an overwrite check and a 'Launch' checkbox to the conclusion page. Use QFormLayout instead QGridLayout for the pages. Task-number: PYSIDE-1112 Change-Id: Ice158553571e30ea069ceda8873bf165dc704afc Reviewed-by: Christian Tismer <tismer@stackless.com>
* wheel_tester: Enable it again for Qt >= 6 with NuitkaChristian Tismer2021-04-073-7/+12
| | | | | | | | | | | | With the usage of nuitka, we have a working compiled test, again. Only the scriptableapplication fails, and only for CMake. This will be fixed in another check-in. The PyInstaller test remains in the code for being re-enabled. Task-number: PYSIDE-1523 Change-Id: Ic831fa5b110bbff4150a01cb8a7344ae050aae02 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Brush up the syntax highlighter exampleFriedemann Kleint2021-04-074-175/+19
| | | | | | | | | | | Change it to a simple highlighter for Python instead of the outdated qmake syntax. Remove the resource file. Task-number: PYSIDE-1112 Change-Id: I49157eccd8dbd26fca85910afb404648d7cc97a3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Port QWidget examples to snake caseFriedemann Kleint2021-04-0637-1922/+1922
| | | | | | Task-number: PYSIDE-1112 Change-Id: Ia42e395a3c650f4c11f05cfe5c6f67d309c4a3d3 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Brush up the collidingmice exampleFriedemann Kleint2021-03-291-77/+77
| | | | | | | | | | | | | | - Port to snake case. - Use per-class imports. - Replace call to obsolete qrand() function. - Fix the random movement (angle) by using setRotation() as does the C++ example. - Use QGraphicsScene.advance() instead of per-mouse timers to advance the scene as does the C++ example. Task-number: PYSIDE-1112 Change-Id: Ibb5b4bde51021d890acb4cc6c2f41a3e0d0207af Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Brush up the standarddialogs exampleFriedemann Kleint2021-03-291-210/+327
| | | | | | | | | | | | | | - Sync it up with the C++ example: * Add a widget for the dialog options * Add QInputDialog.getMultiLineText() - Port to snake case - Use per-class imports - Fix a crash in the font dialog code by using QFont.fromString() Task-number: PYSIDE-1112 Change-Id: I27df02ce0448fbd8dad529500652d58d23b0379c Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Brush up the easing exampleFriedemann Kleint2021-03-296-497/+140
| | | | | | | | | | | | | - Remove the resource file with the outdated Qt logo and use the builtin PySide logo instead. - Use enum for the line type. - Make line type radio box exclusive. - Use snake case. - Use class imports. Task-number: PYSIDE-1112 Change-Id: Ie3e690ab56f619ec95b36b9101b06fa1e4704e5e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>