diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-02-23 17:39:50 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-23 18:44:57 +0000 |
commit | 85b758577e6a0ab1df015785aafe966fc58a6b36 (patch) | |
tree | 89766e46b707b23383b9c89cbd06ab596dfe6b61 | |
parent | 2dd4c40e0c33c06054ff56b02c936ea6ef40bb92 (diff) |
Update and unify README.md of our binding examples
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>
-rw-r--r-- | examples/samplebinding/README.md | 29 | ||||
-rw-r--r-- | examples/scriptableapplication/README.md | 18 | ||||
-rw-r--r-- | examples/widgetbinding/README.md | 42 |
3 files changed, 45 insertions, 44 deletions
diff --git a/examples/samplebinding/README.md b/examples/samplebinding/README.md index 1334600ab..7cd032ffc 100644 --- a/examples/samplebinding/README.md +++ b/examples/samplebinding/README.md @@ -130,6 +130,7 @@ The following requirements need to be met: * A PySide package is installed into the current active Python environment (system or virtualenv) * A new enough version of CMake (**3.1+**). +* ninja For Windows you will also need: * a Visual Studio environment to be active in your terminal @@ -146,28 +147,30 @@ using the current PySide/Shiboken installation. You can build and run this example by executing the following commands (slightly adapted to your file system layout) in a terminal: -On macOS/Linux: +macOS/Linux: ```bash cd ~/pyside-setup/examples/samplebinding -mkdir build -cd build -cmake -H.. -B. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -make -make install -python ../main.py ``` On Windows: ```bash cd C:\pyside-setup\examples\samplebinding +``` + +```bash mkdir build cd build -cmake -H.. -B. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -# or if you have jom available -# cmake -H.. -B. -G "NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release -nmake # or jom -nmake install # or jom install -python ..\main.py +mkdir build +cd build +cmake -H.. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release +ninja +ninja install +cd .. +``` + +The final example can then be run by: +```bash +python main.py ``` #### Windows troubleshooting diff --git a/examples/scriptableapplication/README.md b/examples/scriptableapplication/README.md index 3d31fba3d..d7773c320 100644 --- a/examples/scriptableapplication/README.md +++ b/examples/scriptableapplication/README.md @@ -60,26 +60,22 @@ To build this example with CMake you will need a recent version of CMake (3.1+). You can build this example by executing the following commands (slightly adapted to your file system layout) in a terminal: -On macOS/Linux: +macOS/Linux: ```bash cd ~/pyside-setup/examples/scriptableapplication -mkdir build -cd build -cmake -H.. -B. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -make -./scriptableapplication ``` On Windows: ```bash cd C:\pyside-setup\examples\scriptableapplication +``` + +```bash mkdir build cd build -cmake -H.. -B. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -# or if you have jom available -# cmake -H.. -B. -G "NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release -nmake # or jom -scriptableapplication.exe +cmake -H.. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release +ninja +./scriptableapplication ``` ### Using QMake diff --git a/examples/widgetbinding/README.md b/examples/widgetbinding/README.md index cf68fe98f..5fee93c8c 100644 --- a/examples/widgetbinding/README.md +++ b/examples/widgetbinding/README.md @@ -1,7 +1,7 @@ # WigglyWidget The original Qt/C++ example can be found here: -https://doc.qt.io/qt-5/qtwidgets-widgets-wiggly-example.html +https://doc.qt.io/qt-6/qtwidgets-widgets-wiggly-example.html This example shows how to interact with a custom widget from two different ways: @@ -39,34 +39,36 @@ The most important files are: * `pyside_config.py` which is located in the utils directory, one level up, to get the path for Shiboken and PySide. -Now create a `build/` directory, and from inside run `cmake ..` to use -the provided `CMakeLists.txt`. -To build, just run `make`, and `make install` to copy the generated files -to the main example directory to be able to run the final example: -`python main.py`. -You should be able to see two identical custom widgets, one being the -Python translation, and the other one being the C++ one. - -### Windows - -For windows it's recommended to use either `nmake`, `jom` or `ninja`, -when running cmake. +Now create a `build/` directory, and from inside run `cmake` to use +the provided `CMakeLists.txt`: +macOS/Linux: ```bash -cmake -H.. -B. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release # for nmake -cmake -H.. -B. -G "NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release # for jom -cmake -H.. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release # for ninja +cd ~/pyside-setup/examples/widgetbinding ``` -### Linux, macOS - -Generally using `make` will be enough, but as in the Windows case, you can use -ninja to build the project. +On Windows: +```bash +cd C:\pyside-setup\examples\widgetbinding +``` ```bash +mkdir build +cd build cmake -H.. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release +ninja +ninja install +cd .. ``` +The final example can then be run by: +```bash +python main.py +``` + +You should see two identical custom widgets, one being the +Python translation, and the other one being the C++ one. + ## Final words Since this example originated by mixing the concepts of the `scriptableapplication` |