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
4SubElem := Rectangle {
5 property <int> value: sub.value;
6 callback change();
7 change => { sub.value += 44; }
8 sub := Rectangle {
9 property <int> value: 55;
10 }
11}
12
13TestCase := Rectangle {
14 callback change();
15 change => { sub.change() }
16 property <int> toplevel: sub.value + 1;
17 sub := SubElem { }
18}
19
20
21/*
22
23```rust
24let instance = TestCase::new().unwrap();
25assert_eq!(instance.get_toplevel(), 56);
26instance.invoke_change();
27assert_eq!(instance.get_toplevel(), 56+44);
28```
29
30
31```cpp
32auto handle = TestCase::create();
33const TestCase &instance = *handle;
34assert_eq(instance.get_toplevel(), 56);
35instance.invoke_change();
36assert_eq(instance.get_toplevel(), 56+44);
37```
38
39```js
40var instance = new slint.TestCase({});
41assert.equal(instance.toplevel, 56);
42instance.change();
43assert.equal(instance.toplevel, 56+44);
44```
45
46*/
47