1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/exports"# ] |
2 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
3 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
4 | |
5 | //cpp-namespace: my::ui |
6 | //ignore: rust,js |
7 | struct TestStruct { |
8 | condition: bool, |
9 | } |
10 | |
11 | enum TestEnum { |
12 | A, |
13 | B, |
14 | C |
15 | } |
16 | |
17 | export component TestCase inherits Rectangle { |
18 | in-out property <TestStruct> test_struct; |
19 | in-out property <TestEnum> test_enum; |
20 | } |
21 | |
22 | /* |
23 | ```cpp |
24 | auto handle = my::ui::TestCase::create(); |
25 | const my::ui::TestCase &instance = *handle; |
26 | my::ui::TestStruct test_struct {.condition = false}; |
27 | test_struct.condition = true; |
28 | instance.set_test_struct(test_struct); |
29 | assert(instance.get_test_struct() == test_struct); |
30 | instance.set_test_enum(my::ui::TestEnum::A); |
31 | auto test_enum = instance.get_test_enum(); |
32 | test_enum = my::ui::TestEnum::B; |
33 | instance.set_test_enum(test_enum); |
34 | assert(instance.get_test_enum() == my::ui::TestEnum::B); |
35 | ``` |
36 | |
37 | */} |
38 | |