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
4component DialogBox inherits Rectangle {
5 callback show-dialog();
6
7 show-dialog() => {
8 dialog.show();
9 }
10
11 dialog := PopupWindow { }
12}
13
14export component TestCase inherits Window {
15 height: 30px;
16 width: 30px;
17 dialog := DialogBox { }
18 TouchArea {
19 clicked => {
20 dialog.show-dialog();
21 }
22 }
23}
24
25
26/*
27```cpp
28auto handle = TestCase::create();
29const TestCase &instance = *handle;
30slint_testing::send_mouse_click(&instance, 5., 5.);
31```
32
33```rust
34let instance = TestCase::new().unwrap();
35slint_testing::send_mouse_click(&instance, 5., 5.);
36```
37
38```js
39var instance = new slint.TestCase();
40slintlib.private_api.send_mouse_click(instance, 5., 5.);
41```
42*/
43