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
6global Glop := {
7 property <int> r;
8}
9
10SubSubCompo := Rectangle {
11 property <int> val;
12 TouchArea {
13 clicked => { Glop.r = val; }
14 }
15}
16SubCompo := SubSubCompo { }
17
18export 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
31auto handle = TestCase::create();
32const TestCase &instance = *handle;
33slint_testing::send_mouse_click(&instance, 295., 295.);
34assert_eq(instance.get_result(), 99);
35```
36
37```rust
38let instance = TestCase::new().unwrap();
39slint_testing::send_mouse_click(&instance, 295., 295.);
40assert_eq!(instance.get_result(), 99);
41```
42
43*/
44