aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Fix examples/declarative/usingmodelCristian Maureira-Fredes2018-06-211-4/+4
| | | | | | | | | | | | The problem was related to the recent change on the QByteArray constructors. The roles need to be QByteArray instead of Python strings. Task-number: PYSIDE-703 Change-Id: I7dfc0d2a80ae99d3c10929e9730125c68a0c5950 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add README to QtScript exampleCristian Maureira-Fredes2018-06-211-0/+9
| | | | | | | | | | | The module is not available via wheels, but it is possible to generate the bindings, when building PySide2 from source. Task-number: PYSIDE-707 Change-Id: I9c2f1530e7bc9d77a03abb2b911e2ebf857fca1e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove semicolon from examplesCristian Maureira-Fredes2018-06-1818-67/+67
| | | | | | Task-number: PYSIDE-712 Change-Id: Ib91e4fec88bdb7146e54c285c7f4da60deecb6cf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix examples/charts/calloutCristian Maureira-Fredes2018-06-181-2/+2
| | | | | | | | | Adding null verification before drawing. The reported artifact was related to the use of a Null QPointF. Task-number: PYSIDE-701 Change-Id: Idcfbdf4b0bd98369a407e83404cd4fc8f1def3a0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add missing image to examples/multimedia/cameraCristian Maureira-Fredes2018-06-181-0/+21
| | | | | | Task-number: PYSIDE-704 Change-Id: I11bfa79667ecde38ec9d8bb20e8114f430ccb1e3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix examples/declarative/extending/chapter5Cristian Maureira-Fredes2018-06-181-8/+8
| | | | | | Task-number: PYSIDE-708 Change-Id: I57c2e05c02ce58a65428cd75098a85abad1bc07b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove semi-colon from examples/tutorial/t5Cristian Maureira-Fredes2018-06-181-4/+4
| | | | | | Task-number: PYSIDE-709 Change-Id: I9d7eeaf7b5a26a8fc58be1092639e64d7262c8d5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix examples/declarative/extending/chapter4Cristian Maureira-Fredes2018-06-181-7/+8
| | | | | | Task-number: PYSIDE-708 Change-Id: I5f393336207d68661a4fb07a07461bf8a74a719f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add bindings for QtWebEngine (aka Quick)Alexandru Croitor2018-06-072-0/+112
| | | | | | | | | | | There is only one method we really need, QtWebEngine::initialize() which is used for all Qt Quick based WebEngine applications. Otherwise you get a warning upon startup of a Qt Quick WebEngine application, and this might lead to undefined behavior. Task-number: PYSIDE-688 Change-Id: I7de2bbb58c49cb2a41b0e13ffc9de6a3161f3960 Reviewed-by: Christian Tismer <tismer@stackless.com>
* scriptableapplication: execution as one lineCristian Maureira-Fredes2018-06-061-9/+16
| | | | | | | | | | | | | | | | | | The previous approach executed the entered script line-by-line, it was not possible to execute multi-line statements, for example: for i in range(0, 10): print(i) because PyRun_SimpleString was complaining about the colon. To avoid all these extra steps we can concatenate all the lines into one, and then execute it, instead of creating a temporary file. This will delegate error handling to Python. Change-Id: Idda572aa1b2e3daad2ba1ed9d70f0a8714b8c995 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix scriptableapplication after PEP384Cristian Maureira-Fredes2018-06-051-1/+1
| | | | | | | | | | | | | | Due to the PEP384 many casts related to SbkObjectTypes dropped the `const` because of a change on the signature of the methods like `pointerToPython`, `referenceToPython`, among others. Many examples of these changs can be found in the commit: 18dc31becdd994c53a9f894087cf1ef99fbd0232 file `sbkconverter.cpp`. Change-Id: Id7b9f8e14fd931c686608a89e0d989d9026e0c85 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Adapt examples to proper QByteArray constructorCristian Maureira-Fredes2018-06-058-67/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | After correcting the QByteArray behavior, the available constructors are constraint to bytes, bytearrays, and others QByteArrays. The modified lines are methods that use the modified argument as a QByteArray (interally), that is why we now we transform them: "test value" -> b"test value" Bytes are Python 2 and 3 compatible, so it does not affect the version. The only different change is inside `schema.py` where a change was needed to encode a QByteArray into utf-8. Since this is outside our automated test, I manually test it with Python 2.7.15 and 3.6.3 on Linux. Task-number: PYSIDE-669 Change-Id: I8c12533b482150f4aee3d813dc127eb6b819549b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Document the tabbed browser demoVenugopal Shivashankar2018-06-014-2/+8
| | | | | | | | | | | | | - Added docstrings to the examples sources to autogenerate the docs for the different parts. - Updated the conf.py.in to include sphinx.ext.viewcode to generate html for every source file of the example. Change-Id: I668c55070556ca49d12d38c8ec83f09313bffc36 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Pythonize tabbedbrowser exampleCristian Maureira-Fredes2018-05-316-503/+503
| | | | | | | Change the style of the code to follow PEP8 Change-Id: I93eb0df893e8305b4e65ab5318383433b0655625 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add an example that demonstrates bindings to a custom C++ libraryAlexandru Croitor2018-05-1613-22/+1162
| | | | | | | | | | | | | | | | | | | | | A CMake project is included that builds two shared libraries: 1) libuniverse - a hypothetical C++ library for which bindings need to be created. 2) Universe - a Python module containing bindings to the above library. The example showcases the following concepts: * primitive type bindings (bool, std::string) * types with object and value semantics (pass by pointer VS pass by copy) * inheritance and overriding virtual methods * ownership of heap-allocated C++ objects * constructors with default parameters * general structure of CMakeLists.txt file for generating bindings Task-number: PYSIDE-597 Change-Id: I7b0f203e2844e815aa611af3de2b50a9aa9b5bfc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix a few scriptableapplication bugsAlexandru Croitor2018-05-085-89/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Remove LIBPATH because that causes linker warnings on macOS, and its usage is deprecated on Windows. 2) Remove all qmake clang related code, as well as clang code from pyside2_config.py. It used to be needed on Windows because we didn't deploy libclang.dll to the PySide2 dir. Now that we do, the code is unnecessary. 3) Remove README.txt reference. 4) Add clarifying comments in README.md. 5) Remove NO_DEFAULT_PATH from find_library because that causes a failure to find the python library on Ubuntu (makes sense because the specified libdir is /usr/lib, but the actual library is under /usr/lib/[arch], and disabling the option forces CMake not to look under the arch dir. 6) Fix rpath to PySide2 dir not being embedded on Linux (presumably because the link flags style changed to absolute paths, not sure). 7) Fix README to be more precise about how MSBuild needs to be invoked, and how to run the executable. 8) Improve the error handling in the project files. 9) Refactor pyside2_config.py usage. Change-Id: I402d5c42ef7e01e94d3827682564e95ee280b40b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update scriptableapplication exampleCristian Maureira-Fredes2018-05-047-75/+198
| | | | | | | | | | | | | Absolute paths are used to link the PySide2 libraries on Linux, since it's not possible to ship symbolic links inside a wheel. The README.txt was renamed to README.md to allow syntax highlight on modern editors and also to be compatible with online platforms. The README.CMake.txt was merge to the README.md to include the instruction on the same file. Change-Id: Ie0fcb8cda770ff552576f6014b5822f8d278bfe6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change license from all the filesCristian Maureira-Fredes2018-05-03153-153/+153
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Start a tabbed browser exampleFriedemann Kleint2018-04-307-0/+1207
| | | | | | Task-number: PYSIDE-363 Change-Id: Idf7037c1b9efe1ccfce4427a49abc86a6631efa7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add callout QtCharts exampleCristian Maureira-Fredes2018-03-151-0/+258
| | | | | | | https://doc.qt.io/qt-5.10/qtcharts-callout-example.html Change-Id: Id560316d1edc0f7a893526740cc983f4faaa1969 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add line and bar QtChart exampleCristian Maureira-Fredes2018-03-141-0/+117
| | | | | Change-Id: I7938b6932d365b7417fe7c330764004218a524b2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix scriptableapplication build on WindowsCristian Maureira-Fredes2018-03-132-1/+4
| | | | | | | | | | | | CMake failed to find shiboken2 binary (without .exe). The configuration script was unable to get information from the LIBDIR variable, since it is not set automatically on Windows, using LIBDEST if that is the case. Task-number: PYSIDE-627 Change-Id: Id8031891a2da98af33b81b0740e25299828d6fb3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix scriptableapplication to build on macOS with framework QtAlexandru Croitor2018-03-062-0/+12
| | | | | | | | | | | In case of a Qt framework build, shiboken needs to be passed a --framework-include-paths=foo parameter pointing to the Qt framework libdir. This is used by the C++ parser to resolve framework include paths. Task-number: PYSIDE-623 Change-Id: I38cf34a51102265056aea8718ad059aea3438354 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add CMake-based build rules for scriptableapplication exampleAlexandru Croitor2018-02-223-21/+294
| | | | | | | | | Mostly a clean-ish port of the qmake project file, which also uses the pyside_config.py for getting proper include and link paths. Task-number: PYSIDE-597 Change-Id: I87f71b93ecdcc27d49250ccc0710e64300532dab Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Port the QtCharts/Audio exampleFriedemann Kleint2018-02-131-0/+128
| | | | | | | Task-number: PYSIDE-363 Change-Id: Idbc4df4aba83f23f59617c56853671fc46d8e157 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix scriptableapplication example qmake include hackAlexandru Croitor2018-02-021-5/+3
| | | | | | | | | I'm not sure why the hack was there in the first place. Includes seem to be always copied into the package, so we can simply query for the includes path, and pass that along to qmake INCLUDEPATH. Change-Id: Ib3af020fa9f841f57e00ac0cd4c3548b47b3e459 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add Qt3DFriedemann Kleint2018-01-311-0/+164
| | | | | | Task-number: PYSIDE-487 Change-Id: I17100eda57fbe5015b6c8ff531a3c62b22e8de95 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Re-add Qt Creator Python project file examples.pyqtcFriedemann Kleint2018-01-251-0/+103
| | | | | | | | Amends 9f2a9aba3aff73e31ea15eb4a7a04b0e50f4ee4e. Task-number: PYSIDE-363 Change-Id: I38506877e32c0f5a7eb62a61b391f2d476c36ee8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Example: Adjust the boundingRect for the PieChartVenugopal Shivashankar2018-01-175-5/+5
| | | | | | | | | The extending QML tutorial examples draw PieChart that looks clipped, unless the boundingRect is adjusted. Task-number: PYSIDE-363 Change-Id: Ice4715f94ebae472d22596232ad1f22df59cea0f Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
* Port OpenGL hellogl2 example which uses shadersAlexandru Croitor2018-01-151-0/+473
| | | | | Change-Id: I77ecf92e32ec1177f008b98c44b56567c3b11696 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add missing image to widgets/animation/animatedtilesFriedemann Kleint2018-01-151-0/+0
| | | | | | | | Amends 9f2a9aba3aff73e31ea15eb4a7a04b0e50f4ee4e. Task-number: PYSIDE-363 Change-Id: If22a5bf2705671cec7d75519030de73eaa8a391f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move examples from submodule to pyside-setupFriedemann Kleint2018-01-12235-0/+44249
Move PySide2 examples that are owned by the Qt Company to a new examples directory. Done-with: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Task-number: PYSIDE-363 Change-Id: I14099764d9eef2bc35e067086121427955862e3a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>