aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * Fix classwizard example (str -> QByteArray)Cristian Maureira-Fredes2019-03-271-3/+4
| | | | | | | | | | Change-Id: I0c82e2d5a8fb431f55dd9d54ecaab48d8f40adb6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-03-251-1/+1
|\ \ | |/ | | | | Change-Id: I799b9e4784722de40e53922f7355ab801b924833
| * Fix standarddialog QFontDialog.getFont (returns)Cristian Maureira-Fredes2019-03-211-1/+1
| | | | | | | | | | | | Change-Id: I3b5420963445987f407d4332d0823e2790210f0a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-03-1911-149/+158
|\ \ | |/ | | | | Change-Id: I137dc1d4b7dc73ee8ad4cff2eb031e2aaead2644
| * Fix animation/alignment of the chartthemes examplesCristian Maureira-Fredes2019-03-181-33/+48
| | | | | | | | | | | | | | | | | | The AnimationOption and Align comboboxes were not properly working because an int was used instead of the flag. Change-Id: I3472b94f6ee05169c31869078961f4d5e8e7397a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Remove unnecessary show() in tutoralCristián Maureira-Fredes2019-03-146-6/+0
| | | | | | | | | | Change-Id: I0a72f484fb5591f8c1d47fa534407c8e15cdb396 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Move the .pyqtc files to .pyproject filesFriedemann Kleint2019-03-014-110/+110
| | | | | | | | | | | | | | Use the new project file format. Change-Id: I69f488c285343500edd999b746ce244a56504030 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.12' into devFriedemann Kleint2019-02-044-2/+139
|\ \ | |/ | | | | Change-Id: I22fe4e58477f979cab347f2d6303472f97a53860
| * Tabbed browser example: Add history listFriedemann Kleint2019-01-314-2/+139
| | | | | | | | | | Change-Id: I4b668b7d14a872a5d140a53f22249d7778750679 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.12' into dev" into ↵Friedemann Kleint2019-01-302-0/+202
|\ \ | |/ | | | | refs/staging/dev
| * Add QtRemoteObjects classesFriedemann Kleint2019-01-302-0/+202
| | | | | | | | | | | | | | | | | | | | | | For starters, add the classes so that ready-made classes like QAbstractItemModelReplica can be used. Actually implementing repc requires another step. Task-number: PYSIDE-862 Change-Id: I28adb1d45c262f298f0ad1926198ec6a3013542f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add codeeditor exampleCristian Maureira-Fredes2019-01-302-0/+193
|/ | | | | | | Based on Qt's Code Editor example Change-Id: I17ba0dfbafcda5a599cd2ef051e842cdd4b6e305 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Change example scripts permissions to 644Cristian Maureira-Fredes2018-12-12117-117/+0
| | | | | | | | | | | There was a mix of 644 and 755, since we expect the users to execute: python example.py we do not need to have files with 755. Change-Id: Iba9b2f5dbb57fe2a3503d8dfe971a4e92e764022 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simo Fält <simo.falt@qt.io>
* syntaxhighlighter example: Fix upFriedemann Kleint2018-12-111-73/+47
| | | | | | | | | | | - Use a QTextStream to read lines correctly. - Base it on QSyntaxHighlighter instead of hooking into the text document. - Streamline code and use standard keybindings - Fix imports. Change-Id: I2bd9571c85bb3cca1e90cd9cb441dfe35d26b685 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Update scriptableapplication Qt versionCristian Maureira-Fredes2018-12-061-1/+1
| | | | | | Change-Id: Iacd6f6cccac5427b3ac4585ab237b403abd0f29c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix shiboken2 module import from exampleCristian Maureira-Fredes2018-12-051-1/+1
| | | | | | Change-Id: If2783d4796dced281a5f90c3847ac105860f1807 Fixes: PYSIDE-866 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add tests to install built wheels and build some examplesAlexandru Croitor2018-10-123-14/+32
| | | | | | | | | | | | | | | | | | | | Augment coin_test_instructions.py to run a new script testing/wheel_tester.py, which tries to pip install the built wheels, and then tries to build the samplebinding and scriptableapplication examples. This allows us to confirm that the generated wheels are actually installable, and also hopefully prevent us from breaking the embeddable examples, by making sure that they at least build (and execute in the case of samplebinding). The change also modifies the examples to be able to take the python executable as build argument, so that wheel_tester can specify explicitly which python interpeter to use. Change-Id: I0f141e40ab86e3311dd25915c4e53b0af36aaae9 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Allow building shiboken2 and PySide2 as separate wheelsAlexandru Croitor2018-10-125-160/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actually this creates 3 wheel packages: - shiboken2 (the python module and libshiboken shared library) - shiboken2-generator (contains the generator executable, libclang and dependent Qt libraries) - PySide2 (the PySide2 modules and Qt shared libraries, and tools like rcc, uic) Calling the setup.py script will not do the actual build now (in the sense of calling CMake, make, etc.). Instead it will spawn new processes (via subprocess.call) calling the same setup.py script, but with different arguments. These "sub-invocations" will do the actual building. Thus, the "top-level invocation" will decide which packages to build and delegate that to the "sub-invocations" of setup.py. A new optional command line argument is introduced called "--build-type" which defaults to "all", and can also be set to "shiboken2", "shiboken2-generator" and "pyside2". A user can choose which packages to build using this option. The "top-level invocation" uses this option to decide how many "sub-invocations" to execute. A new command line argument called "--internal-build-type" takes the same values as the one above. It defines which package will actually be built in the new spawned "sub-invocation" process. The "top-level invocation" sets this automatically for each "sub-invocation" depending on the value of "--build-type". This option is also useful for developers that may want to debug the python building code in the "sub-invocation". Developers can set this manually via the command line, and thus avoid the process spawning indirection. A new class Config is introduced to facilitate storage of the various state needed for building a single package. A new class SetupRunner is introduced that takes care of the "--build-type" and "--internal-build-type" argument handling and delegation of "sub-invocations". A new class Options is introduced to 'hopefully', in the future, streamline the mess of option handling that we currently have. setup.py now is now simplified to mostly just call SetupRunner.run_setup(). Certain refactorings were done to facilitate further clean-up of the build code, the current code is definitely not the end all be all. Various other changes that were needed to implement the wheel separation: - a new cmake_helpers directory is added to share common cmake code between packages. - the custom popenasync.py file is removed in favor of using subprocess.call in as many places as possible, and thus avoid 10 different functions for process creation. - Manifest.in is removed, because copying to the setuptools build dir is now done directly by prepare_packages functions. - because prepare_packages copies directly to the setuptools build dir, avoiding the pyside_package dir, we do less copying of big Qt files now. - versioning of PySide2 and shiboken2 packages is now separate. shiboken2 and shiboken2-generator share the same versions for now though. - shiboken2 is now listed as a required package for PySide2, to facilitate pip requirements.txt dependencies. - coin_build_instructions currently needs to install an unreleased version of wheel, due to a bug that breaks installation of generated wheel files. - added separate command line options to pyside2_config.py for shiboken2-module and shiboken2-generator. - adapted samplebinding and scriptableapplication projects due to shiboken being a separate package. - adapted pyside2-tool and shiboken2-tool python scripts for setup tools entry points. - made some optimizations not to invoke cmake for shiboken2-generator when doing a top-level "all" build. - fixed unnecessary rpaths not to be included on Linux (mainly the Qt rpaths). Task-nubmer: PYSIDE-749 Change-Id: I0336043955624c1d12ed254802c442608cced5fb Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* utils/pyside2_config.py: Fix warning about module imp being deprecated as of ↵Friedemann Kleint2018-09-251-3/+18
| | | | | | | | | | | | | | | | Python 3.4 Enclose in a function returning the suffixes, fixing: pyside-setup/examples/scriptableapplication/../utils/pyside2_config.py:41: DeprecationWarning: the imp module is deprecated in favor of importlib; see the module's documentation for alternative uses import os, glob, re, sys, imp pyside/pyside-setup/examples/scriptableapplication/../utils/pyside2_config.py:41: DeprecationWarning: the imp module is deprecated in favor of importlib; see the module's documentation for alternative uses import os, glob, re, sys, imp pyside/pyside-setup/examples/scriptableapplication/../utils/pyside2_config.py:41: DeprecationWarning: the imp module is deprecated in favor of importlib; see the module's documentation for alternative uses import os, glob, re, sys, imp Change-Id: I2298303cb84f9037d5848aca722506adbf1151ba Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix fortuneserver string return typeCristian Maureira-Fredes2018-07-311-7/+0
| | | | | | | | | | | | We don't need a special treatment after the QByteArray and Python string patch. The issue is not fully fixed, but the missing part is reported under PYSIDE-341 Task-number: PYSIDE-705 Change-Id: I4a043eff188deb28cb1fa5c5eb653ace75ce073e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add chart themes exampleCristian Maureira-Fredes2018-07-133-0/+493
| | | | | | | Task-number: PYSIDE-738 Change-Id: I9567eeb3350ab39656f13ee9218f535ec3782a87 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add text properties QML exampleCristian Maureira-Fredes2018-07-122-0/+303
| | | | | | Task-number: PYSIDE-738 Change-Id: I5f22cd322d4414d5ee4be38042b0fc849c40987a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add model data exampleCristian Maureira-Fredes2018-07-121-0/+183
| | | | | | Task-number: PYSIDE-738 Change-Id: I21d19112cef4aff73505e5e5ae533c9a428e74f5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add nested donuts exampleCristian Maureira-Fredes2018-07-111-0/+137
| | | | | | Task-number: PYSIDE-738 Change-Id: I16c8bbfaa8c7ed6fc08ed6b16c9bdf8dd23ce0a2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add percent bar chart exampleCristian Maureira-Fredes2018-07-111-0/+99
| | | | | | | Task-number: PYSIDE-738 Change-Id: I0b62e0b93b64ab3a8c4447650c430941a7b4ae0c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add legend exampleCristian Maureira-Fredes2018-07-111-0/+252
| | | | | | Task-number: PYSIDE-738 Change-Id: I68614a1a0e417f8318adc4f008d452bc280abcb3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add donut chart breakdown exampleCristian Maureira-Fredes2018-07-111-0/+181
| | | | | | | Task-number: PYSIDE-738 Change-Id: I9b75a87615ef5888d98e21c8429f425a05e3a08c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Doc: Fix typos and minor editsVenugopal Shivashankar2018-06-251-1/+1
| | | | | | | | In addition, scaled down the app screenshot. Change-Id: I9edf9bf6dc3c2f4e81097feaccaa266498776a6f Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix examples/charts/memoryusageCristian Maureira-Fredes2018-06-211-6/+4
| | | | | | | | Verified on Windows and Linux. Task-number: PYSIDE-702 Change-Id: I37d5cca1c9351cb599f9d7152a04c13118dab8e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>