You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/src/getting-started/2-our-first-cxx-qt-module.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,13 +69,13 @@ Additionally, we need to either `impl Default` or `#[derive(Default)]` for our s
69
69
```
70
70
71
71
The Rust struct can be defined just like a normal Rust struct and can contain any kind of field, even Rust-only types.
72
-
If a field is marked as `#[qproperty]` it will be exposed to the C++ side as a `Q_PROPERTY`.
72
+
If a field is tagged as `#[qproperty]` it will be exposed to the C++ side as a `Q_PROPERTY`.
73
73
74
74
That means the newly created QObject subclass will have two properties as members: `number` and `string`. For names that contain multiple words, like `my_number`, CXX-Qt will automatically rename the field from snake_case to camelCase to fit with C++/QML naming conventions (e.g. `myNumber`).
75
75
76
76
### Types
77
77
78
-
Do note though that any fields marked as `#[qproperty]` must be types that CXX can translate to C++ types.
78
+
Do note though that any fields tagged as `#[qproperty]` must be types that CXX can translate to C++ types.
0 commit comments