| 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 | //include_path: ../../helper_components |
| 5 | import { UseGlobal } from "export_globals.slint" ; |
| 6 | TestCase := Rectangle { |
| 7 | ug := UseGlobal {} |
| 8 | property<int> p1: ug.used42; |
| 9 | property<int> p2: ug.used44; |
| 10 | } |
| 11 | /* |
| 12 | |
| 13 | ```cpp |
| 14 | auto handle = TestCase::create(); |
| 15 | const TestCase &instance = *handle; |
| 16 | assert_eq(instance.get_p1(), 42); |
| 17 | assert_eq(instance.get_p2(), 44); |
| 18 | ``` |
| 19 | |
| 20 | ```rust |
| 21 | let instance = TestCase::new().unwrap(); |
| 22 | assert_eq!(instance.get_p1(), 42); |
| 23 | assert_eq!(instance.get_p2(), 44); |
| 24 | ``` |
| 25 | |
| 26 | ```js |
| 27 | var instance = new slint.TestCase({}); |
| 28 | assert.equal(instance.p1, 42); |
| 29 | assert.equal(instance.p2, 44); |
| 30 | ``` |
| 31 | |
| 32 | */ |
| 33 | |