slint/tests/cases/exports/cpp_namespace.slint
Aurindam Jana 3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00

36 lines
No EOL
911 B
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
//cpp-namespace: my::ui
//ignore: rust,js
struct TestStruct {
condition: bool,
}
enum TestEnum {
A,
B,
C
}
export component TestCase inherits Rectangle {
in-out property <TestStruct> test_struct;
in-out property <TestEnum> test_enum;
}
/*
```cpp
auto handle = my::ui::TestCase::create();
const my::ui::TestCase &instance = *handle;
my::ui::TestStruct test_struct {.condition = false};
test_struct.condition = true;
instance.set_test_struct(test_struct);
assert(instance.get_test_struct() == test_struct);
instance.set_test_enum(my::ui::TestEnum::A);
auto test_enum = instance.get_test_enum();
test_enum = my::ui::TestEnum::B;
instance.set_test_enum(test_enum);
assert(instance.get_test_enum() == my::ui::TestEnum::B);
```
*/