aboutsummaryrefslogtreecommitdiffstats
path: root/examples/scriptableapplication
Commit message (Collapse)AuthorAgeFilesLines
* Examples: Use theme iconsFriedemann Kleint2024-03-141-3/+3
| | | | | | | | Add some missing icons. Task-number: PYSIDE-2206 Change-Id: I7763f3ad145427dd97084e6191fd4828c2432baa Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Replace cmake -H with -SAdrian Herrmann2024-03-111-3/+3
| | | | | | | | | | | | The previously undocumented cmake -H has been replaced with the official -S in 3.13, update the documentation accordingly: https://cgold.readthedocs.io/en/latest/glossary/-H.html Pick-to: 6.6 Change-Id: I54fb700a36746b49a04449e8c9af21fd2bd235c7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Adapt to glue code to namespaced Qt buildsFriedemann Kleint2024-01-302-2/+2
| | | | | | Task-number: PYSIDE-2590 Change-Id: I7269b0f1c1758a9d26579267fc0b423c6a0422ac Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add QLatin1StringFriedemann Kleint2024-01-081-0/+2
| | | | | | | | | It is needed For the QIcon::ThemeIcon fields. Task-number: PYSIDE-2497 Task-number: PYSIDE-2537 Change-Id: I11d94c150dfa614797038e56cd37128bf3e88cff Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken6: Replace options related to nb_zero by nb_boolFriedemann Kleint2023-09-061-1/+1
| | | | | | | | | | | | | | nb_zero is Python 2 terminology. Rename the related functions and use new options. [ChangeLog][shiboken6] The command line options --use-operator-bool-as-nb_nonzero and --use-isnull-as-nb_nonzero have been replaced by --use-operator-bool-as-nb-bool and --use-isnull-as-nb-bool, respectivily to match Python 3 terminology. The old options continue to work. Change-Id: I1201f4b15e021c8df96740149c20fa1478c12ae1 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* scriptableapplication example: Pass script as a single stringFriedemann Kleint2023-06-134-16/+11
| | | | | | | | | Do not split and re-assemble the lines. Task-number: PYSIDE-2206 Pick-to: 6.5 Change-Id: I95c19c142285a65e1b77b30c36c2f3c24560c91f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* scriptableapplication example: Brush upFriedemann Kleint2023-06-131-19/+28
| | | | | | | | | Use auto and new string literals. Break long lines. Task-number: PYSIDE-2206 Pick-to: 6.5 Change-Id: I5022636de8fe19359a212173fcc93ae08309cc5e Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Add license headers to cmake filesFriedemann Kleint2023-02-161-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Task-number: QTBUG-105718 Task-number: QTBUG-88621 Change-Id: I98bd2e80f182d8bf7aef6b633f37a428e2dac69b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Build system: Use modern form of finding and linking Qt librariesFriedemann Kleint2022-11-291-3/+1
| | | | | | | Pick-to: 6.4 Task-number: PYSIDE-962 Change-Id: I91aed62a8e14bbc1101b4f23e25f57a5d6bca173 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Build system: Bump versionsFriedemann Kleint2022-10-251-2/+2
| | | | | | | | | | | | State CMake 3.18+ and Python >= 3.7 Task-number: PYSIDE-2091 Pick-to: 6.4 Change-Id: Iad906a48bf4378ceeeebe5a55aeaa3f27ea0a61f Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix binding,scriptable examples when no build typeAdrian Herrmann2022-08-221-1/+1
| | | | | | | | | | | | Fix a problem where building the samplebinding, widgetbinding and scriptableapplication examples would fail if the CMAKE_BUILD_TYPE variable was not explicitly set. Amends f9f620436058efe93d086c5214955c4d56e70e26. Pick-to: 6.2 6.3 Change-Id: I6fa8afc386d259a16812bd69148d6299f3b70233 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix binding, scriptable examples for Windows debugAdrian Herrmann2022-08-091-1/+15
| | | | | | | | | | | | | | Fix the samplebinding, widgetbinding and scriptableapplication examples for debug configurations on Windows: 1. Account for the python_d executable name vs python 2. Same for the pyd file name for the binding examples (module_d.pyd instead of module.pyd) Pick-to: 6.2 6.3 Change-Id: I60933e8968401e03c829b797c5bc67a4db8d115d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-277-343/+14
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Examples: Raise C++ standard to 17 for Qt 6Friedemann Kleint2022-05-131-2/+2
| | | | | | | Pick-to: 6.3 Change-Id: I55bbaeff95bc55aef6a5e13f18a42752c29f61d8 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Migrate from QLatin1Char to UTF-16 char literalsFriedemann Kleint2022-04-251-1/+2
| | | | | | | | | Preparing for the deprecation of QLatin1Char in 6.4. Task-number: QTBUG-98434 Pick-to: 6.3 6.2 Change-Id: I8bc92aa9f4e6dbfcb12d2025c5a1e760ab4f0d7f Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix scriptableapplication to build on macOS with framework Qt, amendChristian Tismer2022-03-211-2/+3
| | | | | | | | | | | | | | | | The original fix worked with qmake, but the cmake version has a bug. The setting for "qt_core_library_location_dir" was two levels too deep. This fixes the cmake build as-is. The next check-in removes qmake and uses Ninja. Amends {471b05f35a9c57d7fa910cf9f11c7f5fdfbf2a93} Task-number: PYSIDE-623 Change-Id: I288f2e9cd9479843718fa8b498ded51c9c6b140b Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Update example documentation of samplebinding / scriptableapplicationFriedemann Kleint2021-12-101-12/+22
| | | | | | | | Update versions and build information. Pick-to: 6.2 Change-Id: I82eb4b36e2357145f89bb640f2674deda6fe2253 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Document the scriptableapplication, samplebinding examplesFriedemann Kleint2021-12-082-64/+93
| | | | | | | | | | Add a dummy .pyproject file into the doc directory for the example gallery script to collect it. Convert the .md files to .rst files for the documentation. Pick-to: 6.2 Change-Id: I87ea5b980d3d2177a7851f71462ca0b0bd0eba7e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* scriptable: make it work by default on macOS, tooChristian Tismer2021-11-221-1/+1
| | | | | | | | | | | | | | | Some platforms like Homebrew's macOS name the Python interpreter "python3", while others use "python" as the default name. In any case, it is correct to use the Python 3 version as default, because Python 2 is deprecated. The default now tries "python3" first and falls back to "python". Task-number: PYSIDE-1710 Change-Id: I8850b2c157d219e7785177f41425dca1c2144f99 Pick-to: 6.2 5.15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Define SbkObjectType to be a PyTypeObjectFriedemann Kleint2021-09-111-1/+1
| | | | | | | | | | | | | | | SbkObjectType was a struct embedding a PyTypeObject after fec1611e9f42c1f0a13eb33474df2ed8ee480842. Remove that and make the types equvivalent, which allows for removing many reinterpret_casts. SbkObjectType is left as a typedef for client code snippets. [ChangeLog][shiboken6] SbkObjectType is now a typedef for PyTypeObject. Task-number: PYSIDE-535 Change-Id: I44812311ccbbe0988c38e34c47d16f6874f8d1cf Reviewed-by: Christian Tismer <tismer@stackless.com>
* wheel_tester: Enable it again for Qt >= 6 with NuitkaChristian Tismer2021-04-071-1/+1
| | | | | | | | | | | | 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>
* Port the Qt bindings examples to the <QtModule/QtClass> conventionFriedemann Kleint2021-02-241-4/+1
| | | | | | | | | This simplifies the shiboken call; the global Qt include directory can be passed instead of each single QtCore/QtGui/QtWidgets directory. Pick-to: 6.0 Change-Id: I55a59ad12b0a9596a2c8d9dc7f0b9c041c38665c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Update and unify README.md of our binding examplesFriedemann Kleint2021-02-231-11/+7
| | | | | | | | ninja is the only working generator for Qt 6. Pick-to: 6.0 Change-Id: I9640f646ffea7b21659966680df52a21ead7119d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* 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. Pick-to: 6.0 Task-number: PYSIDE-841 Change-Id: Ib87ddd9fa9e4dbdcf413abe1d9e6273811fc414c Reviewed-by: Christian Tismer <tismer@stackless.com>
* 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' Pick-to: 6.0 Pick-to: 5.15 Task-number: PYSIDE-841 Change-Id: Ibf1caa1a797faab5dd8e4bfa6eb23296bb7945a5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-022-6/+6
| | | | | | | | 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-025-101/+100
| | | | | | | | - 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>
* Fix the C++ - based examples to workFriedemann Kleint2020-10-293-9/+11
| | | | | | | 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-281-1/+1
| | | | | | | | | | * 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-284-28/+28
| | | | | | | | 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-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-041-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | Initial port of Core,Gui,Widgets,Network,Qml,Quick to Qt 6Friedemann Kleint2020-07-031-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* 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>
* 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>
* 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>
* Add tests to install built wheels and build some examplesAlexandru Croitor2018-10-122-12/+25
| | | | | | | | | | | | | | | | | | | | 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-123-19/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* Add an example that demonstrates bindings to a custom C++ libraryAlexandru Croitor2018-05-163-299/+16
| | | | | | | | | | | | | | | | | | | | | 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-038-8/+8
| | | | | | | | | | | | | | | | | 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>
* 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>