Skip to content

Commit 43f0013

Browse files
BenFordTytheringtonahayzen-kdab
authored andcommitted
Update book
1 parent aad8060 commit 43f0013

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

book/src/bridge/attributes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ The C++ `namespace` which to emit `extern "RustQt"` items and the namespace to f
1616
An item will inherit the namespace specified on it's surrounding `extern` block if any,
1717
otherwise the namespace specified with the top level `cxx_qt::bridge` attribute, if any, will be used.
1818

19+
> **📝 Note**: The `#[namespace = "..."]` attribute is not allowed on signals, methods or inherited methods
20+
1921
```rust,ignore,noplayground
2022
{{#include ../../../examples/qml_features/rust/src/threading.rs:book_namespace_macro}}
2123
```
@@ -26,6 +28,10 @@ The `#[cxx_name = "..."]` attribute replaces the name that C++ should use for th
2628

2729
The `#[rust_name = "..."]` attribute replaces the name that Rust should use for this item.
2830

31+
For [`#[qproperty]`](./extern_rustqt.md#properties), a CXX or Rust name can be provided inside the attribute like so
32+
33+
`#[qproperty(T, name, cxx_name = "MyName", rust_name = "my_name")]`
34+
2935
> **📝 Note**: If an item has different C++ and Rust identifiers, it is always referenced by its Rust identifier inside the bridge, not its C++ identifier. (e.g. when referring to a QObject inside a `#[qenum(...)]` attribute)
3036
3137
> **⚠️ Deprecation warning**:

0 commit comments

Comments
 (0)