| 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 |
| 5 | import { UseStruct , ExportedStruct, ExportEnum , } from "export_structs.slint" ; |
| 6 | TestCase := 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 |
| 18 | auto handle = TestCase::create(); |
| 19 | const TestCase &instance = *handle; |
| 20 | assert_eq(instance.get_p1(), 2003); |
| 21 | assert_eq(instance.get_exp().e.a, 2001); |
| 22 | ``` |
| 23 | |
| 24 | ```rust |
| 25 | let instance = TestCase::new().unwrap(); |
| 26 | assert_eq!(instance.get_p1(), 2003); |
| 27 | assert_eq!(instance.get_exp().e.a, 2001); |
| 28 | ``` |
| 29 | |
| 30 | ```js |
| 31 | var instance = new slint.TestCase({}); |
| 32 | assert.equal(instance.p1, 2003); |
| 33 | assert.equal(instance.exp.e.a, 2001); |
| 34 | ``` |
| 35 | |
| 36 | */ |
| 37 | |