| 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 | |
| 5 | TestCase := Rectangle { |
| 6 | |
| 7 | width: 100px; |
| 8 | height: 200px; |
| 9 | |
| 10 | r := Rectangle { |
| 11 | // default geometry for width & height |
| 12 | animate height { duration: 1s; } |
| 13 | animate width { duration: 1s; } |
| 14 | } |
| 15 | |
| 16 | property<bool> test: r.width == 100px && r.height == 200px; |
| 17 | } |
| 18 | |
| 19 | /* |
| 20 | ```rust |
| 21 | let instance = TestCase::new().unwrap(); |
| 22 | assert!(instance.get_test()); |
| 23 | ``` |
| 24 | |
| 25 | ```cpp |
| 26 | auto handle = TestCase::create(); |
| 27 | const TestCase &instance = *handle; |
| 28 | assert(instance.get_test()); |
| 29 | ``` |
| 30 | |
| 31 | ```js |
| 32 | let instance = new slint.TestCase({}); |
| 33 | assert(instance.test, 1); |
| 34 | ``` |
| 35 | |
| 36 | */ |
| 37 | |