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 | // Test for issue #781 |
5 | |
6 | global Glop := { |
7 | property <int> r; |
8 | } |
9 | |
10 | SubSubCompo := Rectangle { |
11 | property <int> val; |
12 | TouchArea { |
13 | clicked => { Glop.r = val; } |
14 | } |
15 | } |
16 | SubCompo := SubSubCompo { } |
17 | |
18 | export TestCase := Window { |
19 | width: 300px; |
20 | height: 300px; |
21 | HorizontalLayout { |
22 | SubCompo { val: 88; } |
23 | SubCompo { val: 99; } |
24 | } |
25 | |
26 | property <int> result: Glop.r; |
27 | } |
28 | |
29 | /* |
30 | ```cpp |
31 | auto handle = TestCase::create(); |
32 | const TestCase &instance = *handle; |
33 | slint_testing::send_mouse_click(&instance, 295., 295.); |
34 | assert_eq(instance.get_result(), 99); |
35 | ``` |
36 | |
37 | ```rust |
38 | let instance = TestCase::new().unwrap(); |
39 | slint_testing::send_mouse_click(&instance, 295., 295.); |
40 | assert_eq!(instance.get_result(), 99); |
41 | ``` |
42 | |
43 | */ |
44 | |