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
4export 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
15let instance = TestCase::new().unwrap();
16instance.window().set_size(slint::PhysicalSize::new(300, 500));
17assert_eq!(instance.get_t_width(), 300);
18
19```
20
21```cpp
22auto handle = TestCase::create();
23const TestCase &instance = *handle;
24instance.window().set_size(slint::PhysicalSize({300, 500}));
25assert_eq(instance.get_t_width(), 300);
26```
27*/
28