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 TestCase := Rectangle {
5
6 property<int> bar: 5;
7 property<int> foo: 3;
8 foo := Rectangle {
9 property<int> bar: 7;
10 property<int> foo: 9;
11 property<int> inner: bar * 10 + self.bar * 100 + parent.bar * 1000;
12 }
13
14 property<int> p1: foo.inner;
15 property<int> p2: self.foo *10 + foo.foo * 100 + bar *1000;
16}
17/*
18```cpp
19auto handle = TestCase::create();
20const TestCase &instance = *handle;
21assert_eq(instance.get_p1(), 5770);
22assert_eq(instance.get_p2(), 5930);
23```
24
25```rust
26let instance = TestCase::new().unwrap();
27assert_eq!(instance.get_p1(), 5770);
28assert_eq!(instance.get_p2(), 5930);
29```
30
31```js
32var instance = new slint.TestCase({});
33assert.equal(instance.p1, 5770);
34assert.equal(instance.p2, 5930);
35```
36*/
37