1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
3
4global Glob := {
5 property <int> a_alias <=> a;
6 property <int> a: 3;
7 property <int> b: a + 3;
8
9}
10
11TestCase := Rectangle {
12 callback set_a(int);
13 set_a(a) => { Glob.a_alias = a; }
14 property <int> value1: Glob.b;
15 property <bool> test: value1 == 3+3;
16}
17
18/*
19```rust
20let instance = TestCase::new().unwrap();
21assert_eq!(instance.get_value1(), 3+3);
22instance.invoke_set_a(4);
23assert_eq!(instance.get_value1(), 4+3);
24```
25
26```cpp
27auto handle = TestCase::create();
28const TestCase &instance = *handle;
29assert_eq(instance.get_value1(), 3+3);
30instance.invoke_set_a(4);
31assert_eq(instance.get_value1(), 4+3);
32```
33
34```js
35let instance = new slint.TestCase({});
36assert.equal(instance.value1, 3+3);
37instance.set_a(4);
38assert.equal(instance.value1, 4+3);
39```
40
41*/
42