From 43f0013a3be8928a6f8f3f36d6e9ccecf1532711 Mon Sep 17 00:00:00 2001 From: Ben Ford Date: Fri, 20 Sep 2024 15:49:44 +0100 Subject: [PATCH] Update book --- book/src/bridge/attributes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/book/src/bridge/attributes.md b/book/src/bridge/attributes.md index d8b3bc198..58bcc2615 100644 --- a/book/src/bridge/attributes.md +++ b/book/src/bridge/attributes.md @@ -16,6 +16,8 @@ The C++ `namespace` which to emit `extern "RustQt"` items and the namespace to f An item will inherit the namespace specified on it's surrounding `extern` block if any, otherwise the namespace specified with the top level `cxx_qt::bridge` attribute, if any, will be used. +> **📝 Note**: The `#[namespace = "..."]` attribute is not allowed on signals, methods or inherited methods + ```rust,ignore,noplayground {{#include ../../../examples/qml_features/rust/src/threading.rs:book_namespace_macro}} ``` @@ -26,6 +28,10 @@ The `#[cxx_name = "..."]` attribute replaces the name that C++ should use for th The `#[rust_name = "..."]` attribute replaces the name that Rust should use for this item. +For [`#[qproperty]`](./extern_rustqt.md#properties), a CXX or Rust name can be provided inside the attribute like so + +`#[qproperty(T, name, cxx_name = "MyName", rust_name = "my_name")]` + > **📝 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) > **⚠️ Deprecation warning**: