SixtyFPS -> Slint in the C++ documentation

This commit is contained in:
Simon Hausmann 2022-02-02 14:48:22 +01:00
parent ad4eea9e96
commit f48d7d9f9e
13 changed files with 44 additions and 44 deletions

View file

@ -1,11 +1,11 @@
# Getting Started
Once SixtyFPS is built, you can use it in your CMake application or library target in two steps:
Once Slint is built, you can use it in your CMake application or library target in two steps:
1. Associate the `.slint` files that you'd like to use by calling the `slint_target_sources` cmake command. The first parameter is
your application (or library) CMake target, and the parameters following are the names of the `.slint` files. This will result in the
`.slint` files to be compiled into C++ source code.
2. The generated C++ source code also needs the SixtyFPS run-time library. This dependency is satisfied by linking `Slint::Slint`
2. The generated C++ source code also needs the Slint run-time library. This dependency is satisfied by linking `Slint::Slint`
into your target with the `target_link_libraries` command.
A typical example looks like this:
@ -18,12 +18,12 @@ project(my_application LANGUAGES CXX)
# if you prefer the package approach.
include(FetchContent)
FetchContent_Declare(
SixtyFPS
Slint
GIT_REPOSITORY https://github.com/sixtyfpsui/sixtyfps.git
GIT_TAG v0.1.6
SOURCE_SUBDIR api/cpp
)
FetchContent_MakeAvailable(SixtyFPS)
FetchContent_MakeAvailable(Slint)
add_executable(my_application main.cpp)
slint_target_sources(my_application my_application_ui.slint)
@ -65,17 +65,17 @@ int main(int argc, char **argv)
}
```
This works because the SixtyFPS compiler translated `my_application_ui.slint` to C++ code, in the `my_application_ui.h`
This works because the Slint compiler translated `my_application_ui.slint` to C++ code, in the `my_application_ui.h`
header file. That generated code has a C++ class that corresponds to the `HelloWorld` element and has API to create
the ui, read or write properties or set callbacks. You can learn more about how this API looks like in general in the
[](generated_code.md) section.
## Tutorial
For an in-depth walk-through, you may be interested in reading our walk-through <a href="../tutorial/cpp">SixtyFPS Memory Game Tutorial Tutorial</a>.
For an in-depth walk-through, you may be interested in reading our walk-through <a href="../tutorial/cpp">Slint Memory Game Tutorial Tutorial</a>.
It will guide you through the `.slint` mark-up language and the C++ API by building a little memory game.
## Template
You can clone the [Template Repository](https://github.com/sixtyfpsui/sixtyfps-cpp-template) repository with
the code of a minimal C++ application using SixtyFPS that can be used as a starting point to your program.
the code of a minimal C++ application using Slint that can be used as a starting point to your program.