| 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 | component Container inherits Rectangle { |
| 5 | GridLayout { |
| 6 | padding: 0phx; |
| 7 | spacing: 0phx; |
| 8 | Row { |
| 9 | Rectangle { |
| 10 | width: 150phx; |
| 11 | background: green; |
| 12 | } |
| 13 | @children |
| 14 | Rectangle { |
| 15 | width: 30phx; |
| 16 | background: yellow; |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export component TestCase inherits Container { |
| 23 | width: 300phx; |
| 24 | height: 200phx; |
| 25 | |
| 26 | rect1 := Rectangle { |
| 27 | background: black; |
| 28 | @children |
| 29 | } |
| 30 | |
| 31 | out property <bool> rect1_pos_ok: rect1.x == 150phx; |
| 32 | |
| 33 | out property <bool> test: rect1_pos_ok; |
| 34 | } |
| 35 | /* |
| 36 | ```cpp |
| 37 | auto handle = TestCase::create(); |
| 38 | const TestCase &instance = *handle; |
| 39 | assert(instance.get_rect1_pos_ok()); |
| 40 | ``` |
| 41 | |
| 42 | |
| 43 | ```rust |
| 44 | let instance = TestCase::new().unwrap(); |
| 45 | assert!(instance.get_rect1_pos_ok()); |
| 46 | ``` |
| 47 | */ |
| 48 | |