aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Port examples away from deprecated QMouseEvent::pos()Friedemann Kleint2021-03-196-29/+32
| | | | | | | | | | | As a drive by, fix the left-over QtCharts callout example to work after 227020b118fa38ada1d8bd579593dae61f6e3881. Task-number: PYSIDE-1122 Change-Id: I945b57950014e882d4efd3cb0cab47262ad108b6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 306ecd14ccba188a1c88061715456c329c1ff79c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: migrate qdoc approach to document examplesCristian Maureira-Fredes2021-03-176-0/+79
| | | | | | | | | | | | | | | | | | There were two previous documented examples using the approach based on qdoc: stardelegate, and classwizard. This patch moves them into the 'doc/' directory for each example, and partially revert the changes from 308157f01260c640e21f6972619d3b380c007acb Additionally, an unrelated screenshot was moved to a new general 'images/' directory. Task-number: PYSIDE-1112 Change-Id: I239a24fa4e4f970540857ba8b33b9b13c18142b1 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit d97aedf37809c479ab409c4247b60c0cfcef35d6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: use 'doc' directory for examples galleryCristian Maureira-Fredes2021-03-173-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial patch that generates a gallery based on the examples in the respository, was limited to only showing the content of the files in each '.pyproject' file. That approach didn't allow to describe each example, nor add complementary images, like screenshots to each example page. This patch introduces the option to consider everything inside a 'doc/' directory on the example directory. The files that are copied over are not directory, but only files, for images to be the main focus. For example, currently the Tetrix case contained the following files: $ ls examples/widgets/tetrix/ tetrix.py tetrix.pyproject On this patch you can see that now there is a doc directory with the following content: $ ls examples/widgets/tetrix/doc tetrix-screenshot.png tetrix.rst The example page that will be generated for this case will contain the content of the 'doc/tetrix.rst' file, plus the content of all the project files at the end. The 'doc/tetrix.rst' file contains a reference to the 'tetrix-screenshot.png' image, so that file will be copied over too. Task-number: PYSIDE-1112 Change-Id: I2d11833c461d8073d2d2888576d876d3f834103a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit f930fce091fbcc0cdc4d1d57ee688966b26ea53e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* examples: add example with arguments parameter in SignalMaxime Roussin-Bélanger2021-03-033-0/+151
| | | | | | | | Change-Id: Ib6f19b5bad1644fb5eb062a5cbe512db2f2a8adc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 8fd8d8f56cb06079ed7adf5fea916b3841229381) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port the Qt bindings examples to the <QtModule/QtClass> conventionFriedemann Kleint2021-02-244-14/+8
| | | | | | | | | | This simplifies the shiboken call; the global Qt include directory can be passed instead of each single QtCore/QtGui/QtWidgets directory. Change-Id: I55a59ad12b0a9596a2c8d9dc7f0b9c041c38665c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit cfe6ac20a7aaac8c4689c3e22f839e6d95886944) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update and unify README.md of our binding examplesFriedemann Kleint2021-02-233-44/+45
| | | | | | | | | ninja is the only working generator for Qt 6. Change-Id: I9640f646ffea7b21659966680df52a21ead7119d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 28f76593fa6177a3a97fd308f0404529a7337169) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add model example with Pandas DataFrameSacha Schutz2021-02-164-0/+274
| | | | | | | | | | | | | Create a PandasModel working with a QTableView to show DataFrame from Pandas library patch : add missing pyproject Change-Id: I16e2580f3fceba34a2491354394b3c78dd981a98 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit b9aa61247c355a9330e52059951649c6ba7697c2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PySide6: Add the logo as a resource to libpysideFriedemann Kleint2021-02-102-1/+6
| | | | | | | | | Use it in prominent examples. Change-Id: Ifee67802194931bbd56fbe6e6bfa4f3c18fda781 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit ac7365aa78d78a3693c46e2177df3216d0a40628) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* example: add qtquickcontrols2 galleryCristian Maureira-Fredes2021-02-1064-0/+11059
| | | | | | | | | | This example was ported from the qt/qtquickcontrols2 repository. Task-number: PYSIDE-1112 Change-Id: Idd6ad0d0cdf5c7dfaf6d8f3af878607c273aebd8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ae8f5327e21786690e021344cf2c122a02c89440) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* examples: directory structureCristian Maureira-Fredes2021-02-09161-267/+2650
| | | | | | | | | | | | | | | | | | | | | | | | When generating the gallery automatically, the structure of the examples was not the same for all the modules. This reorganization was made under the following assumption: An example requires: - its own directory, - a '.pyproject' file, - one or more '.py' files, - extra files (likes images, .rc, .ui, etc) Even for cases when subdirectories are made to depict categories, like 'widgets/state-machine/...', one directory is required per example. There should not be '.pyproject' files for categories, except for the general 'examples.pyproject' to open all of them. Task-number: PYSIDE-1490 Change-Id: Ie690773c816a248016dbebaad90fbb1d1c2aeea5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 33743aeb2be37d166bcc3291a98dd22026871cef)
* scriptable application: Actually make the generated module availableFriedemann Kleint2021-01-062-10/+8
| | | | | | | | | | | | A call to PyImport_AppendInittab() before Py_Initialize() is required to be able to import the module. Previously, the example would only add the instance of the mainwindow under the "__main__" module. Task-number: PYSIDE-841 Change-Id: Ib87ddd9fa9e4dbdcf413abe1d9e6273811fc414c Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit b62040783613568901e76a26799e130632004a7e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* scriptable application/Unix: Remove setting of PYTHONHOME for virtualenvFriedemann Kleint2021-01-051-3/+1
| | | | | | | | | | | | | On Linux, with 3.8, it causes an error in conjunction with virtualenv: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' Task-number: PYSIDE-841 Change-Id: Ibf1caa1a797faab5dd8e4bfa6eb23296bb7945a5 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 05db21e661c6ba9eb69516cb1386bcbd431b7d2d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-02176-499/+499
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Binding Example helpers: Remove version numbersFriedemann Kleint2020-11-0210-210/+219
| | | | | | | | - Rename the scripts - Introduce variables for the versions in pyside_config.py Change-Id: I1dcb8ca7eee259f25af0db7c09abd30484c7e99c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Examples: Remove utils.pyFriedemann Kleint2020-11-026-68/+15
| | | | | | | It is no longer required for Python3. Change-Id: I5cbdcae5273e59e494c61319fe986c4611dbab97 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix the C++ - based examples to workFriedemann Kleint2020-10-294-16/+21
| | | | | | | Adapt CMakeList.txt, fix includes. Change-Id: Idc9636bee798c4a025b70f91b8379a9b9c79a82c Reviewed-by: Christian Tismer <tismer@stackless.com>
* examples: Remove Python 2.7 and <3.6 related codeCristian Maureira-Fredes2020-10-2822-66/+10
| | | | | | | | | | * removing from __future__ import ... * updating CMakeLists.txt files * removing special if-else for Python 2 and 3 Change-Id: I8a34b06b6b384ebc5323f20f7c15c357a5be6d62 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-289-77/+77
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-125-69/+86
|\ | | | | | | Change-Id: I7f16e4f178bff9c37af3b7a9d536c5d6f42c66fb
| * Brush up the basicsortfiltermodel exampleFriedemann Kleint2020-10-091-54/+65
| | | | | | | | | | | | | | | | | | | | | | | | Replace the deprecated QRegExp by QRegularExpression, introducing an enumeration for the filter types as is done in the C++ example. Import classes. Task-number: PYSIDE-841 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I6aa1bc2b325bb5168c70be3c28a59c5c7629fe3e Reviewed-by: Christian Tismer <tismer@stackless.com>
| * Replace deprecated API in examplesFriedemann Kleint2020-10-084-15/+21
| | | | | | | | | | | | | | | | | | | | | | - Replace qrand() by QRandomGenerator - Replace QMatrix by QTransform Task-number: PYSIDE-841 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I8609a9ce90a6df1cb7c7f1b9aab61695edf41a3f Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix some examples to run with Qt 6Friedemann Kleint2020-10-082-4/+5
| | | | | | | | | | | | | | | | Task-number: PYSIDE-841 Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ide9c869d73d14c56c06e39c0e2447761595978c9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-061-49/+54
|\| | | | | | | Change-Id: I7b4ff138799ee81940c36e68a105cb42bb38a3ff
| * Polish the flow layout exampleFriedemann Kleint2020-10-021-49/+54
| | | | | | | | | | | | | | | | | | | | - Import by class - Rename variables and functions, - Fix long lines Task-number: PYSIDE-841 Change-Id: Icb4615e15d0b54d3e2893ffa7981ced7b7526952 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-305-1/+22
|\| | | | | | | Change-Id: I13721e13d2fab13945385fe529afe4ab431e0532
| * samplebinding: Add a sample property definitionFriedemann Kleint2020-09-295-1/+22
| | | | | | | | | | | | Task-number: PYSIDE-1019 Change-Id: Ieecd08c451c47951ebe05d86b0932ef2682821aa Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-211-0/+2
|\| | | | | | | Change-Id: Ia31df23a16575f9ecefe13ec85fb70197d103278
| * Revert "Fix running scriptableapplication in a virtualenv on Linux with ↵Friedemann Kleint2020-09-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | Python 3.8" It still is required for macOS. This reverts commit 38814354ff6a30258b79947304fd3a6be4dc7089. Change-Id: Ic24c113009db9b0ade3a77f147ffc6f452663715 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-173-7/+5
|\| | | | | | | Change-Id: I8aa48d07067c45c888c73af87314f6a88c2a6e14
| * Fix running scriptableapplication in a virtualenv on Linux with Python 3.8Friedemann Kleint2020-09-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the environment setting introduced by 435bc2744cd108efc1511bf17117bd4f0de15b43 for Linux. It is required for Windows only due to the changed library load policy. On Linux, it causes: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' Task-number: PYSIDE-1236 Change-Id: I58e71f877b6cb754290a4d0ae41518255181fafc Reviewed-by: Christian Tismer <tismer@stackless.com>
| * scriptableapplication: Fix deprecated APIFriedemann Kleint2020-09-162-5/+5
| | | | | | | | | | | | | | Use QScreen and operator | for shortcuts. Change-Id: I9756a63622683b362eab90083795704c29738936 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Bump cmake version to 3.16Friedemann Kleint2020-09-043-6/+6
| | | | | | | | | | | | | | | | | | | | Streamline the features list handling in the module CMakeLists to use the list functionality introduced in cmake 3.3. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I184034cae408c815bd80a09016a21fde2969449e Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Remove QtScript, QtXmlPatternsFriedemann Kleint2020-09-0418-1096/+0
| | | | | | | | | | | | | | | | | | They are obsolete in Qt 6. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I70816b3c3270a1db65ad3b3871a09c62d31420e5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-08-311-55/+56
|\| | | | | | | Change-Id: Icf4b3535be52b64ef15eced7103bb1280e031e30
| * Polish the syntaxhighlighter exampleFriedemann Kleint2020-08-201-55/+56
| | | | | | | | | | | | | | | | Rename variables and functions to snake case and streamline code. Change-Id: Ia4d1b36f5cebfe8ef58f161bafa3e1628109c865 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Fix a few examples to workFriedemann Kleint2020-07-2710-15/+16
| | | | | | | | | | | | | | | | | | Adapt to the Qt 6 API. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia471ae8acc454dbbdd05700d08aee5bd6a265cee Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-07-203-0/+223
|\| | | | | | | Change-Id: I5c6913b4eea9d6e11415011753e556eca18c5532
| * add quick painteditem exampleJimmy Girardet2020-07-153-0/+223
| | | | | | | | | | | | Task-number: PYSIDE-841 Change-Id: I9ba6e6dfe9c5755d7246c44f78e2c3eeae0d5cf7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Add QtOpenGLWidgetsFriedemann Kleint2020-07-149-1770/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLWidget has been moved from QtWidgets into a separate library. Fix the examples and remove obsolete examples using deceased QGLWidget. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ib291d49c22ee6a32d7c03b6ff4980e87c8a09ecb Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-07-131-413/+472
|\| | | | | | | Change-Id: I509b55363c29639cd29bfbc012c4bda3a4d008e5
| * Rewrite the settings editor exampleFriedemann Kleint2020-07-101-420/+469
| | | | | | | | | | | | | | | | | | | | | | | | | | - Port settings editor example from QRegExp to QRegularExpression - Use snake case names - Import classes - Make the type checking mechanism work for more types by reading out bool/int values from QSettings by type - Use QCheckBox, QSpinBox for bool/int Change-Id: Ib6b69536df3f26afa5c0e2babed7bad5de471d7f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-07-075-50/+70
|\| | | | | | | Change-Id: I299a65f15fb6b7eb900256590bbe76ad0568f546
| * Port some examples from QRegExp to QRegularExpressionFriedemann Kleint2020-07-066-57/+80
| | | | | | | | | | | | | | | | | | QRegExp is deprecated. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I5c5dc4965a03fbd1a3370be3fa9e64c5df6a9fd8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Initial port of Core,Gui,Widgets,Network,Qml,Quick to Qt 6Friedemann Kleint2020-07-0318-312/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test failures: shiboken2:testmodifyfunction pyside2:QtCore::qbytearray_test pyside2:QtGui::bug_PYSIDE-41 pyside2:QtGui::deepcopy_test pyside2:QtGui::qfontmetrics_test pyside2:QtGui::qpixmapcache_test pyside2:QtWidgets::api2_test (QTBUG-85417) pyside2:QtWidgets::bug_632 pyside2:QtWidgets::bug_714 pyside2:QtWidgets::bug_785 pyside2:QtWidgets::qshortcut_test pyside2:QtQml::bug_825 pyside2:QtQml::bug_1029 pyside2:QtQml::registertype pyside2:QtQml::qqmlincubator_incubateWhile pyside2:QtQml::signal_arguments Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia43d7ed037dfdd07def0edd76bada2243e73d335 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-06-2010-0/+949
|\| | | | | | | Change-Id: I59be4217917d79b90169fe494438781b5bdcebf1
| * 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.15' into devFriedemann Kleint2020-06-053-8/+8
|\| | | | | | | Change-Id: I1249882922ea66d35f7a43eeb8cc720f261591c1
| * 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>