1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
4//include_path: ../../helper_components
5import { UseStruct , ExportedStruct, ExportEnum , } from "export_structs.slint";
6TestCase := Rectangle {
7 property <ExportedStruct> exp: { d: 3001, e: {a: 2001} };
8 u := UseStruct {
9 exp: { d: 3002, e: {a: 2002} };
10 nexp: { b: 3003, c: {a: 2003} };
11 }
12 out property<bool> xx: ExportEnum.Hello != ExportEnum.Bonjour;
13 property<int> p1: u.nexp.c.a;
14}
15/*
16
17```cpp
18auto handle = TestCase::create();
19const TestCase &instance = *handle;
20assert_eq(instance.get_p1(), 2003);
21assert_eq(instance.get_exp().e.a, 2001);
22```
23
24```rust
25let instance = TestCase::new().unwrap();
26assert_eq!(instance.get_p1(), 2003);
27assert_eq!(instance.get_exp().e.a, 2001);
28```
29
30```js
31var instance = new slint.TestCase({});
32assert.equal(instance.p1, 2003);
33assert.equal(instance.exp.e.a, 2001);
34```
35
36*/
37