You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Upgrade the PIP - package installer for Python (_optional_)
35
+
36
+
```
37
+
pip install --upgrade pip
38
+
```
39
+
40
+
* Install the Qt for Python `PySide6` package via PIP
41
+
42
+
```
43
+
pip install PySide6
44
+
```
45
+
46
+
### Integrated development environment (IDE)
47
+
48
+
#### Qt Creator
33
49
34
-
### QT Creator
35
50
* Download Qt Online Installer from [qt.io](https://www.qt.io/download-qt-installer-oss). More info at [doc.qt.io](https://doc.qt.io/qt-6/qt-online-installation.html).
36
51
* Install Qt for desktop development using a custom installation that includes the following components:
37
52
* Qt
@@ -44,39 +59,45 @@ Different types of examples are provided. All examples have a frontend implement
44
59
* [] Developer and Designer Tools
45
60
* [x] Qt Creator x.y.z
46
61
47
-
### VSCode
48
-
* Download an install VSCode
62
+
#### VS Code (_alternative to Qt Creator_)
63
+
64
+
* Download an install VS Code
49
65
* Add the python extension
50
-
* Rename the folder `vscode` to `.vscode`. The `launch.json` file will then be read by VSCode
66
+
* Rename the folder `vscode` to `.vscode`. The `launch.json` file will then be read by VS Code
51
67
* Select any python file in the repo and choose the desired python environment
52
68
53
69
54
70
## How to run
55
71
56
72
### Type I Examples: BasicQml (QML runtime with QML backend)
57
73
58
-
This example is located in `examples/BasicQml` and the source code is in the subfolder `src/BasicQml`. The example consists of a graphical QML frontend (`Gui/Application.qml`) and a QML backend (`Logic/Mock/BackendProxy.qml`). It is considered a mock backend as it only returns hardcoded values rather than providing the required functionality. The entry point for Qt is `main.qml`, whcih can be displayed using Qt `qml` viewer.
74
+
This example is located in `examples/BasicQml` and the source code is in the subfolder `src/BasicQml`. The example consists of a graphical QML frontend (`Gui/Application.qml`) and a QML backend (`Logic/Mock/BackendProxy.qml`). It is considered a mock backend as it only returns hardcoded values rather than providing the required functionality. The entry point for Qt is `main.qml`, which can be displayed using Qt `qml` viewer.
59
75
60
-
#### Qt Creator IDE (QML Runtime)
61
-
* Run Qt Creator
62
-
* Open the qml project file `*.qmlproject` from the example folder from `src/BasicQml.qmlproject`
63
-
* Click Run (Green play button)
76
+
#### Run using the QML Runtime
77
+
78
+
##### Run from the terminal
64
79
65
-
#### Run from the terminal (QML Runtime)
66
80
* Go to the example folder, e.g.,
67
81
68
82
```sh
69
-
$ cd examples/BasicQml/src/BasicQml
83
+
cd examples/BasicQml/src/BasicQml
70
84
```
71
85
72
86
* Run `main.qml` (specifying the paths to the current directory `.` and the EasyApp module directory `../../../..`) using the `qml` tool installed with the Qt Framework in the previous step, e.g., like this
##### Run via the Qt Creator IDE (_alternative to run from the terminal_)
93
+
94
+
* Run Qt Creator
95
+
* Open the qml project file from the example folder `examples/BasicQml/src/BasicQml.qmlproject`
96
+
* Click Run (Green play button)
97
+
78
98
#### How to edit GUI elements in live mode
79
-
* In Qt Creator, select the `.qml` file to be edited in live mode
99
+
100
+
* In Qt Creator, select the `*.qml` file to be edited in live mode
80
101
* Click the `Design` button at the top of the left sidebar of `Qt Creator`
81
102
*_Note: If this button is disabled, find and click `About plugins...` in the `Qt Creator` menu, scroll down to the `Qt Quick` section and enable `QmlDesigner`._
82
103
* In the `Design` window, click the `Show Live Preview` button in the top panel of the application (small play button in a circle).
@@ -87,30 +108,35 @@ This example is located in `examples/BasicQml` and the source code is in the sub
87
108
88
109
This example is located in `examples/BasicMinimalPy` with the source code in `src/BasicMinimalPy`. This example serves to demonstrate how an application with a QML frontend and a QML backend (similar to the Type I example) can be executed from Python. The entry point for the Python program is `main.py` file. To execute this do the following:
89
110
90
-
#### QtCreator IDE (Python Runtime)
91
-
* Run Qt Creator
92
-
* Open the python project file `*.pyproject` from the example folder from `examples/BasicMinimalPy/src/BasicMinimalPy.pyproject`
93
-
* Select the desired python environment with the Qt `PySide6` module installed
94
-
* Click Run (Green play button)
111
+
#### Run using the Python interpreter
95
112
96
-
#### VSCode IDE (Python Runtime)
97
-
* Open the repo in VSCode
98
-
* Click on the debug extension and select which example to execute
### Type III Examples: BasicPy and IntermediatePy (Python runtime with Python backend)
114
140
115
141
These examples demonstrate how to use a Python runtime to execute the QML frontend and the Python backend located in `Logic/Py/backend_proxy.py`. These examples can be run through Python in the same way as Type II described above. These examples have a Python-based backend (proxy object), which gets created in `main.py` and then exposed to QML. The Qt QML frontend then acceses the backend by calling methods exposed by the proxy object in the `Py` folder.
116
142
@@ -120,4 +146,6 @@ These examples demonstrate how to use a Python runtime to execute the QML fronte
120
146
121
147
### Type IV Examples: BasicC++
122
148
123
-
These examples can be run after compilation into an executable program. They only have a mock backend in QML (the C++ backend is not implemented). The minimum configuration requires a base `main.cpp` file and, if Qt Creator is used as the IDE, a `*.pro` file.
149
+
This example can be run after compilation into an executable program. It only has a mock backend in QML (the C++ backend is not implemented). The minimum configuration requires a base `main.cpp` file and, if Qt Creator is used as the IDE, a `*.pro` file.
150
+
151
+
This example is currently used to create a WebAssembly application that can be run inside a web browser.
0 commit comments