aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Add custom widget shiboken exampleCristian Maureira-Fredes2020-06-1910-0/+949
| | | | | | | | | | | | | | This example is based on the WigglyWidget Qt/C++ example, and shows two ways of using a Custom Widget: * A full translation to Python, wigglywidget.py * Exposing the widget via Shiboken. The main.py file includes both scenarios and display them. Task-number: PYSIDE-841 Change-Id: I53c6db540aae2d5672a96bcf8f0e4a3e06b7ce9e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-06-043-8/+8
|\ | | | | | | Change-Id: Idcc60eae05f86165d4ed8829c9bb745b5dc068bd
| * Tabbedbrowser example: Fix download removalFriedemann Kleint2020-05-281-1/+1
| | | | | | | | | | | | | | | | Fix class name broken by 90c1c767095e583d0315e87c0592597020858246. Task-number: PYSIDE-1311 Change-Id: Ib562a0ba3b4fc0a586ff642ddfad77075c4d9240 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Tabbedbrowser example: Fix downloadsFriedemann Kleint2020-05-273-7/+7
| | | | | | | | | | | | | | | | Fix names broken by 90c1c767095e583d0315e87c0592597020858246. Task-number: PYSIDE-1311 Change-Id: I4533209dfe47b07138fd797eb2f67321ba3b83a5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Add QtQuickControls2Cristian Maureira-Fredes2020-05-261-1/+2
| | | | | | | | | | | | | | | | | | This exposes the C++ class QQuickStyle Task-number: PYSIDE-487 Change-Id: I5776421070362d8b3bf9556eb28a410de3c90948 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Add example contributions from Hacktoberfest 2019Cristian Maureira-Fredes2020-05-1511-1/+781
| | | | | | | | | | | | | | | | | | | | | | | | | | Adding examples contributed from Github. Thanks to the contributors: - María José Molina-Contreras https://github.com/mjmolina - Sabine Wolf https://github.com/Lythi45 - Meili Triantafyllidi https://github.com/mei-li - Elena Hirjoaba https://github.com/puskini33 Change-Id: I7abfc6149af2e02c947ab9f088af1d09492de5df Reviewed-by: Christian Tismer <tismer@stackless.com>
* | example: add systray exampleCristian Maureira-Fredes2020-05-158-0/+2922
| | | | | | | | | | | | | | | | | | Adding an example with systray functionality, since we didn't have any in our repo. Task-number: PYSIDE-841 Change-Id: I7df67c55d38c1f98f9e4c28c82e6253bae494272 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-05-061-14/+6
|\| | | | | | | Change-Id: If256dd2b05ef2e31592cf50327ec9a2d6fb742bb
| * samplebinding: Fix running with Python 3.8.2 on WindowsFriedemann Kleint2020-05-051-14/+6
| | | | | | | | | | | | | | | | | | | | | | Copy the shiboken DLL into the source directory. Since it does not make sense to hardlink into the build directory and install to another directory, remove the hardlink logic. Fixes: PYSIDE-1236 Change-Id: I016dac916502f4c28785981244e29e91e61700fe Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | scriptableapplication: Fix deprecation warningFriedemann Kleint2020-04-141-1/+1
| | | | | | | | | | | | | | | | Fix: mainwindow.cpp:117:118: warning: ‘QStringList QString::split(QChar, QString::SplitBehavior, Qt::CaseSensitivity) const’ is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations] Change-Id: I13cc693ce25d9feedc1d9207de273a4645b8d36c Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-04-071-0/+71
|\| | | | | | | Change-Id: Id9d77dcbb396227a670e4455031ce074488c9e17
| * Add an example for QUiLoaderFriedemann Kleint2020-03-301-0/+71
| | | | | | | | | | | | Task-number: PYSIDE-841 Change-Id: I3aae15ae88f94f62eb7e11dd9942834ef92c55ad Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-03-271-1/+1
|\| | | | | | | Change-Id: I6f4621d935f74fe7ecdbaf588a05523dd44712ce
| * Remove qApp import from chartthemes examplesCristian Maureira-Fredes2020-03-261-1/+1
| | | | | | | | | | Change-Id: I3edb414046dc46c5f55c6b3a9980644ba2d0235a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-03-257-77/+103
|\| | | | | | | Change-Id: Ibcd8a3b5c6d1d2f636fd21b162c67a85e727c2c4
| * TabbedBrowser example: Fix most flake8 warningsFriedemann Kleint2020-03-247-77/+103
| | | | | | | | | | | | | | | | | | Fix indentation, shorten lines where possible. Fix documentation URL. Amends 90c1c767095e583d0315e87c0592597020858246. Change-Id: I9b61cb27c7c336b706b418d4cd1ed1d3b80c7be3 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Friedemann Kleint2020-03-236-6/+6
|\|
| * Examples: Remove qApp importFriedemann Kleint2020-03-166-6/+6
| | | | | | | | | | | | | | | | | | Amends 5d34d60418b15d4d6837d0a1333f2b57631309eb, d579912b31d7cfa7b0b216916fbbf3eb632a9d9d. Task-number: PYSIDE-571 Change-Id: I214d7bf1770667eaa9abaea0f96b5e507b4c32f7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Add a widget gallery exampleFriedemann Kleint2020-03-233-0/+488
|/ | | | | | | | | Port the widget gallery example added to Qt 5.15 by qtbase/7b0f34187224fe754f4171f1d2fe5fa3f48baf82 to Python. Change-Id: If70e5dd3a8b08fbf8aed1c894a374fffdebc6f57 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix running scriptableapplication in a virtualenv on Windows with Python 3.8Friedemann Kleint2020-03-041-4/+20
| | | | | | | | | | As of Python 3.8, Python is no longer is able to run stand-alone in a virtualenv due to missing libraries. Add the path to the modules instead. Task-number: PYSIDE-1236 Change-Id: I4ef1f02925d11900d35cc4e5fcc9f50a5e123c2f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Examples: Adapt to new qApp variableFriedemann Kleint2020-02-2521-23/+23
| | | | | | | | Amends d579912b31d7cfa7b0b216916fbbf3eb632a9d9d. Task-number: PYSIDE-571 Change-Id: Ide49ef2c9f99335b5019daea7d27cd1d86e896a4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add the webchannel standalone exampleFriedemann Kleint2020-02-119-0/+575
| | | | | | | Task-number: PYSIDE-1199 Change-Id: Icc138844b0cb5e7ccb502cbe840fc578fad8ca8f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: replace wrong license headerCristián Maureira-Fredes2020-01-306-158/+165
| | | | | | | | By mistake some examples were released under LGPL, but Qt for Python examples are distributed with the BSD license. Change-Id: Idbbf2067f2321d14cb3276ea36fe13f6551498a6 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Add example for Threads and SignalsAlejandro Gutierrez2020-01-271-0/+98
| | | | | | | | | The goal of this file is to provide an example for signals being emitted from one thread to another. Task-number: PYSIDE-841 Change-Id: If494fbfef6d8c46b37d5b750163c909bc6c55c7a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: improve the star delegate exampleSamuel Gaist2020-01-272-3/+4
| | | | | | | | | | | | | While the example works correctly as is, if one takes the StarEditor class alone, it will fail to work as it uses a starRating attribute that is available in the example only because of the call to setEditorData by the StarDelegate class. This patch fixes that as well makes use of the append overload of QPolygonF taking a list of point to simplify the code a bit. Change-Id: Id8132fa86f5668645f48c62377dac65f707c968b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* xmlpatterns / schema example: Fix build warningFriedemann Kleint2020-01-241-1/+1
| | | | | | | | Compare integers using ==, fixing: schema.py:203: SyntaxWarning: "is" with a literal. Did you mean "=="?( Change-Id: Id94c454d4695bc3b0f89bf6b5301066d722b5e33 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* examples: remove unused importsCristián Maureira-Fredes2020-01-0648-92/+62
| | | | | Change-Id: I85216bcfc23161b832ecb675ea58f33e67004fe9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples: remove semi-colons from filesCristián Maureira-Fredes2020-01-0614-99/+99
| | | | | | Change-Id: Iba52405551440659d60b11b3dfb9078d6066cec6 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add external python modules examplesCristián Maureira-Fredes2019-12-136-0/+633
| | | | | | | | | | | | These examples will be used at the QtWS2019: - Matplotlib: Widget interacting with a 3D plot - OpenCV: Webcam pattern detection - Scikit Image: Image filters An About Qt section was added to all examples. Change-Id: I14da69c9b5ecdc8409bcdb335135a8b1fa763bb1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* examples.pyproject: Fix syntax errorFriedemann Kleint2019-11-011-1/+1
| | | | | | | Amends 728e94e37d44229d8f31dee4761eaf66f89bf01e. Change-Id: If6b067c2d0c25317f324f7edfb46926946cb680a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* scriptableapplication: Use raw string literal for sample codeFriedemann Kleint2019-10-241-4/+5
| | | | | | | Improves readability. Change-Id: I04c4c9c1d78941ba96315a5a4cfe7d26d1b77c90 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add .pyproject files for each exampleCristián Maureira-Fredes2019-09-2761-0/+198
| | | | | Change-Id: I4dec66067aa2b0cc50d1ac3226537e4f09006132 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Example: Replace date type with text for authors' birthdateVenugopal Shivashankar2019-09-201-7/+6
| | | | | | | | | | | Apparently, SQLite does not have the 'date' type. Instead, 'text' type is recommended by its docs. Moreover, the python datetime object does not translate to an appropriate type in SQLite. So str() seems the right alternative for date at the moment. Change-Id: I246c0708e60469a0fb253d33bdf8ab506eece1c9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add missing space after comma according to style guidePaul Wicking2019-07-171-4/+4
| | | | | Change-Id: I66b59ef11aa268e17434832f69af4e2e27146286 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Example: Move the SQL statementsVenugopal Shivashankar2019-06-182-28/+39
| | | | | | | | | | | Moving the SQL statements into separate variables outside the scope of the 'init_db' function, improves readability. Change-Id: I716dfceef6dc343287afab17f74e8de7fae618c6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-06-193-21/+28
|\ | | | | | | Change-Id: I42955abfeb1fe8b7c6443a9b334154984286b9cc
| * Examples: Use QSaveFileFriedemann Kleint2019-06-122-20/+27
| | | | | | | | | | | | | | | | | | QSaveFile should preferably used for writing out files from editor applications to ensure files are properly written and existing files are not overwritten should writing fail. Change-Id: I5d9b98c168649d23f5ee31171b1729fd230dc8de Reviewed-by: Christian Tismer <tismer@stackless.com>
| * TabbedBrowser Example: Fix "Open in new tab"Friedemann Kleint2019-06-111-1/+1
| | | | | | | | | | | | | | | | | | Restore override of QWebEngineView::createWindow() broken by 90c1c767095e583d0315e87c0592597020858246. Change-Id: I6cdc05c3b8edbfb9da24ca3d6502cec2ccce870a Fixes: PYSIDE-1022 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Example: Port the QtSql Books exampleVenugopal Shivashankar2019-05-2010-0/+835
| | | | | | | | | | Change-Id: Ie8b0378f6f8de406700cf8ace381e0022b641617 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-05-065-187/+374
|\| | | | | | | Change-Id: Ia87a2e46bb051f1cccf3b7ba988aeb5eb32c0f0e
| * opengl/contextinfo.py: Polish the example a bitFriedemann Kleint2019-05-031-44/+73
| | | | | | | | | | | | | | | | | | | | | | | | Bring it closer to the C++ counterpart: - Handle High DPI scaling - Add options to control the rendering - Describe the formats of the GL context and surface - Fix the comments in the shaders (otherwise, ANGLE complains) Task-number: PYSIDE-865 Change-Id: I2fa32aa67884a3b0a34805ddcf01040ac9fddf89 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * opengl/contextinfo.py: Fix exception on exitFriedemann Kleint2019-05-021-0/+4
| | | | | | | | | | | | | | | | | | Stop the timer on hiding in exposeEvent(), fixing a warning about QOpenGLContext::makeCurrent() failing. Change-Id: Icaef927696e1c5ce6ea282a9ee3dfdb60968413a Fixes: PYSIDE-865 Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Fix PyInstaller after removal of COIN glitchesChristian Tismer2019-04-291-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After the COIN problems have been removed, the only remaining problem is PyInstaller, which crashes on macOS with Python 2.7.16 . For a full problem description, see the amendment to "Current COIN Wheel Tester Problems" To simplify a later problem analysis, "pip list" is included. Fixes: PYSIDE-996 Change-Id: Ie607ac190ab703a0b8cbe20483b4b60f81634d9d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Regenerate all example forms using the python-extended uic of 5.14Friedemann Kleint2019-04-263-142/+289
| | | | | | | | | | | | Task-number: PYSIDE-797 Change-Id: I69904a6e104fc40ddb6e60e99761ffc30bcf717a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Regenerate all example forms using the python-extended rcc of 5.14Friedemann Kleint2019-04-2614-16408/+15808
| | | | | | | | | | | | Task-number: PYSIDE-855 Change-Id: Ib6f3989f1303f59c095cb12060f45388f0500b41 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-04-244-2/+191
|\| | | | | | | Change-Id: I28805a29caa05e996b490ba46e27ddbc243cc074
| * Provide a spec file for hello.app used by wheel_testerChristian Tismer2019-04-231-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PyInstaller test was done with minimalistic options to keep things as simple as possible. This had the side effect that on certain Python versions and platforms things were touched that created errors, although those things were nowhere in use. It turned out that the generated hello_app.spec file contains the result of an in-depth analysis which touches so many non-existing modules. When using just the generated spec file and no other option, the analysis is almost skipped and the generation of an executable avoids further problems and is faster. This patch removes all arguments and uses a spec file instead. The arguments are kept in a comment, just in case. Change-Id: I17c43a588bc6f95f62fc3104a047dc08e8d8e70d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Automatically Test Small Example With PyInstallerChristian Tismer2019-04-083-2/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A simple hello.py script was modified for running in PyInstaller and stopping to execute after 2 seconds. The reason is to test that PyInstaller works correctly together with the embedded mode of the signature extension on all platforms. The script did first not work on Windows. This is now solved, after an import in pyside2_config.py is fixed. Currently, there are several configuration errors in COIN. Errors are therefore skipped in the PyInstaller build. The test tests only if the generated script works. Change-Id: I7a1b1e738d523b83cc3fe5beafa7e2579f9c7f48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-04-021-3/+4
|\| | | | | | | Change-Id: I7fc1857f15ccf5d9667dd6d6adb8208c775c6722
| * Examples: classwizard import __future__ firstCristian Maureira-Fredes2019-03-281-1/+1
| | | | | | | | | | Change-Id: Iee3070f59472ee6a75495304f841ba012c90e873 Reviewed-by: Christian Tismer <tismer@stackless.com>