1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Copyright (C) 2026 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only
use ;
use cratecall_rust_trait_impl;
use crateGenericRustProxy;
use QParserStatusProxyCpp;
/// A trait for hooking into QML component construction stages.
///
/// [`QParserStatus::class_begin`] is called first when the
/// object is created, followed by [`QParserStatus::component_complete`] once
/// all QML properties have been set. This allows you to defer expensive
/// initialization until the component is fully constructed.
///
/// This trait is the Rust equivalent of
/// [`QQmlParserStatus`](https://doc.qt.io/qt-6/qqmlparserstatus.html).
///
/// This trait requires the `qobject` macro with `Base = QParserStatus` to set
/// up the correct Qt proxy.
///
/// ## Example
///
/// ```rust
/// use qtbridge::{QApp, qobject};
///
/// #[qobject(Base = QParserStatus)]
/// pub mod backend {
/// use qtbridge::QParserStatus;
///
/// #[derive(Default)]
/// pub struct Status {
/// somewhat_ready: bool,
/// }
///
/// impl Status {
/// #[qsignal]
/// fn ready(&mut self);
/// }
///
/// impl QParserStatus for Status {
/// fn class_begin(&mut self) {
/// self.somewhat_ready = true;
/// }
///
/// fn component_complete(&mut self) {
/// if self.somewhat_ready {
/// self.ready();
/// }
/// }
/// }
/// }
///
/// const QML_CODE: &str =
/// r#"
/// import QtQuick
/// import QtQuick.Controls
///# import qtbridge_interfaces
/// // import your module
///
/// ApplicationWindow {
/// visible: true
/// Status {
/// onReady: closeTimer.start()
/// }
/// Timer {
/// id: closeTimer
/// interval: 1
/// onTriggered: Qt.quit()
/// }
/// }
/// "#;
///
/// fn main() {
/// QApp::new()
/// .register::<backend::Status>()
/// .load_qml(QML_CODE.as_bytes())
/// .run();
/// }
/// ```
pub type QParserStatusProxyRust = ;