Type Mappings

The types used for properties in .slint design markup each translate to specific types in C++. The follow table summarizes the entire mapping:

Structures

For user-defined structures in the .slint code, a class of the same name is generated with data member in lexicographic order.

For example, if you have this structure in the .slint file

export struct MyStruct := {
    foo: int,
    bar: string,
}

It would result in the following type being generated:

class MyStruct {
public:
    slint::SharedString bar;
    int foo;
};