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// Issue 7284
5
6component HeaderScreen {
7 GridLayout {
8 Row {
9 @children
10 }
11 }
12}
13
14component Intermediate {
15 HeaderScreen {
16 @children
17 }
18}
19
20export component TestCase inherits Window {
21 h := HeaderScreen { }
22 i := Intermediate { }
23 i2 := Intermediate { Rectangle { height: 32px; } }
24
25 out property <bool> test: h.preferred-height == 0 && i.preferred-height == 0 && i2.preferred-height == 32px;
26}
27
28/*
29```cpp
30auto handle = TestCase::create();
31const TestCase &instance = *handle;
32assert(instance.get_test());
33```
34
35
36```rust
37let instance = TestCase::new().unwrap();
38assert!(instance.get_test());
39```
40*/
41