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
4TestCase := Window {
5 property <int> t_: 8;
6 property <int> t_old: -1;
7 background: {
8 if (t_ == 8) { t_old = t_; t_=1; }
9 t_ == 1 ? white : black
10 }
11
12 property <bool> test: background == Colors.white && t_ == 1 && t_old == 8;
13}
14
15/*
16```cpp
17auto handle = TestCase::create();
18const TestCase &instance = *handle;
19assert(instance.get_test());
20```
21
22```rust
23let instance = TestCase::new().unwrap();
24assert!(instance.get_test());
25
26```
27
28```js
29var instance = new slint.TestCase({});
30assert(instance.test);
31```
32*/
33
34
35
36