| 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 | TestCase := Rectangle { |
| 5 | width: 100phx; |
| 6 | height: 100phx; |
| 7 | property <int> value; |
| 8 | callback clicked; // this callback shouldn't conflict with the other callback |
| 9 | |
| 10 | TouchArea { |
| 11 | clicked => { value += 1; } |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | /* |
| 16 | ```cpp |
| 17 | auto handle = TestCase::create(); |
| 18 | const TestCase &instance = *handle; |
| 19 | slint_testing::send_mouse_click(&instance, 5., 5.); |
| 20 | assert_eq(instance.get_value(), 1); |
| 21 | ``` |
| 22 | |
| 23 | ```rust |
| 24 | let instance = TestCase::new().unwrap(); |
| 25 | slint_testing::send_mouse_click(&instance, 5., 5.); |
| 26 | assert_eq!(instance.get_value(), 1); |
| 27 | |
| 28 | ``` |
| 29 | |
| 30 | ```js |
| 31 | var instance = new slint.TestCase(); |
| 32 | slintlib.private_api.send_mouse_click(instance, 5., 5.); |
| 33 | assert.equal(instance.value, 1); |
| 34 | ``` |
| 35 | */ |
| 36 | |