1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/issues"# ] |
2 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
3 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
4 | |
5 | component DialogBox inherits Rectangle { |
6 | callback show-dialog(); |
7 | |
8 | show-dialog() => { |
9 | dialog.show(); |
10 | } |
11 | |
12 | dialog := PopupWindow { } |
13 | } |
14 | |
15 | export component TestCase inherits Window { |
16 | height: 30px; |
17 | width: 30px; |
18 | dialog := DialogBox { } |
19 | TouchArea { |
20 | clicked => { |
21 | dialog.show-dialog(); |
22 | } |
23 | } |
24 | } |
25 | |
26 | |
27 | /* |
28 | ```cpp |
29 | auto handle = TestCase::create(); |
30 | const TestCase &instance = *handle; |
31 | slint_testing::send_mouse_click(&instance, 5., 5.); |
32 | ``` |
33 | |
34 | ```rust |
35 | let instance = TestCase::new().unwrap(); |
36 | slint_testing::send_mouse_click(&instance, 5., 5.); |
37 | ``` |
38 | |
39 | ```js |
40 | var instance = new slint.TestCase(); |
41 | slintlib.private_api.send_mouse_click(instance, 5., 5.); |
42 | ``` |
43 | */ |
44 | } |
45 | |
46 | #[test ] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> { |
47 | use i_slint_backend_testing as slint_testing; |
48 | slint_testing::init(); |
49 | let instance = TestCase::new().unwrap(); |
50 | slint_testing::send_mouse_click(&instance, x:5., y:5.); |
51 | Ok(()) |
52 | } |