| 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 | export component TestCase { |
| 5 | VerticalLayout { |
| 6 | t := Text { |
| 7 | text: "Hello World" ; |
| 8 | } |
| 9 | } |
| 10 | out property <int> t-width: t.width / 1px; |
| 11 | } |
| 12 | |
| 13 | /* |
| 14 | ```rust |
| 15 | let instance = TestCase::new().unwrap(); |
| 16 | instance.window().set_size(slint::PhysicalSize::new(300, 500)); |
| 17 | assert_eq!(instance.get_t_width(), 300); |
| 18 | |
| 19 | ``` |
| 20 | |
| 21 | ```cpp |
| 22 | auto handle = TestCase::create(); |
| 23 | const TestCase &instance = *handle; |
| 24 | instance.window().set_size(slint::PhysicalSize({300, 500})); |
| 25 | assert_eq(instance.get_t_width(), 300); |
| 26 | ``` |
| 27 | */ |
| 28 | |