|
1 |
| -# Slint C++ Template |
| 1 | +# Slint & KDBindings |
2 | 2 |
|
3 |
| -A template for a C++ application that's using Slint for the user interface and CMake for the build system. |
4 |
| - |
5 |
| -## About |
6 |
| - |
7 |
| -This template helps you get started developing a C++ application with Slint as toolkit |
8 |
| -for the user interface. It demonstrates the integration between the `.slint` UI markup and |
9 |
| -C++ code, how to trigger react to callbacks, get and set properties and use basic widgets. |
10 |
| - |
11 |
| -## Prerequisites |
12 |
| - |
13 |
| -In order to use this template and build a C++ application, you need to install a few tools: |
14 |
| - |
15 |
| - * **[cmake](https://cmake.org/download/)** (3.19 or newer) |
16 |
| - * A C++ compiler that supports C++ version 17 or newer |
17 |
| - |
18 |
| -If your target environment is Linux or Windows on an x86-64 architecture, then you may also opt into downloading one of our binary Slint packages. These are pre-compiled and require no further tools. You can find setup instructions and download links at |
19 |
| - |
20 |
| -<https://slint-ui.com/docs/cpp/cmake.html#binary-packages> |
21 |
| - |
22 |
| -Alternatively, this template will automatically download the Slint sources and compile them. This option requires you to install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started). Once this is done, you should have the ```rustc``` compiler and the ```cargo``` build system installed in your path. |
23 |
| - |
24 |
| -## Usage |
25 |
| - |
26 |
| -1. Clone or download this repository |
27 |
| - ``` |
28 |
| - git clone https://github.com/slint-ui/slint-cpp-template my-project |
29 |
| - cd my-project |
30 |
| - ``` |
31 |
| -2. Configure with CMake |
32 |
| - ``` |
33 |
| - mkdir build |
34 |
| - cmake -B build |
35 |
| - ``` |
36 |
| -3. Build with CMake |
37 |
| - ``` |
38 |
| - cmake --build build |
39 |
| - ``` |
40 |
| -4. Run the application binary |
41 |
| - * Linux/macOS: |
42 |
| - ``` |
43 |
| - ./build/my_application |
44 |
| - ``` |
45 |
| - * Windows: |
46 |
| - ``` |
47 |
| - build\my_application.exe |
48 |
| - ``` |
49 |
| -
|
50 |
| -We recommend using an IDE for development, along with our [LSP-based IDE integration for `.slint` files](https://github.com/slint-ui/slint/blob/master/tools/lsp/README.md). You can also load this project directly in [Visual Studio Code](https://code.visualstudio.com) and install our [Slint extension](https://marketplace.visualstudio.com/items?itemName=Slint.slint). |
51 |
| -
|
52 |
| -## Next Steps |
53 |
| -
|
54 |
| -We hope that this template helps you get started and you enjoy exploring making user interfaces with Slint. To learn more |
55 |
| -about the Slint APIs and the `.slint` markup language check out our [online documentation](https://slint-ui.com/docs/cpp/). |
| 3 | +This example explores the combination of the Slint UI toolkit with KDBindings. It leverages Slint's C++ API to create a simple backend, adapt part of it as a C++ model for use with a Slint listview and keeps things in sync using bindings and properties from KDBindings. |
0 commit comments