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
4TestCase := 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
17auto handle = TestCase::create();
18const TestCase &instance = *handle;
19slint_testing::send_mouse_click(&instance, 5., 5.);
20assert_eq(instance.get_value(), 1);
21```
22
23```rust
24let instance = TestCase::new().unwrap();
25slint_testing::send_mouse_click(&instance, 5., 5.);
26assert_eq!(instance.get_value(), 1);
27
28```
29
30```js
31var instance = new slint.TestCase();
32slintlib.private_api.send_mouse_click(instance, 5., 5.);
33assert.equal(instance.value, 1);
34```
35*/
36