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 | |
4 | TestCase := 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 |
17 | auto handle = TestCase::create(); |
18 | const TestCase &instance = *handle; |
19 | assert(instance.get_test()); |
20 | ``` |
21 | |
22 | ```rust |
23 | let instance = TestCase::new().unwrap(); |
24 | assert!(instance.get_test()); |
25 | |
26 | ``` |
27 | |
28 | ```js |
29 | var instance = new slint.TestCase({}); |
30 | assert(instance.test); |
31 | ``` |
32 | */ |
33 | |
34 | |
35 | |
36 | |