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
* Switch ParsedQProperty to use Name instead of Ident, and allow cxx_name and rust_name in flags
- Add closure to group behaviour of flags requiring a value passed
* Add parsing checks for name flags
- using cxx_name or rust_name is allowed without READ flag
- Maintains error for using property flags e.g. WRITE without including READ
- cxx_name and rust_name must have strings as values, whereas other flags still need idents
* Add naming to a property in test_inputs
- Also refactor value assignment in parse_meta_name_value
- Refactor cxx_name so that having no cxx_name requires no rust_name to do camelcase conversion
* Add new Name method to combine common logic
- Applies options with the correct renaming logic, and this is used in property renaming
- Also switch from format_ident to a propagating syn::parse_string instead
* Update changelog and book
* Add to example and refactor auto_camel in name function
Copy file name to clipboardExpand all lines: book/src/bridge/extern_rustqt.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,8 @@ Using the read flag will cause CXX-Qt to generate a getter function with an auto
141
141
142
142
If a custom function is specified, an implementation both in qobject::MyObject and and export in the bridge is expected.
143
143
144
+
Additionally, usng cxx_name and rust_name is possible similarly to the attributes avilable on other items. e.g. `#[qproperty(i32, num, cxx_name = "numberProp")]`
145
+
144
146
### Examples
145
147
146
148
-`#[qproperty(TYPE, NAME, READ)]` A read only property
@@ -165,6 +167,10 @@ If a custom function is specified, an implementation both in qobject::MyObject a
165
167
- Specifies that the property will not be overriden by a derived class
166
168
-`RESET = my_reset`
167
169
- Specifies a function to reset the property to a default value, user function __must__ be provided or it will not compile
170
+
-`cxx_name = "myCxxName`
171
+
- Specifies an alternative name to use on the C++ side, applying to the property name as well as autogenerated functions
172
+
-`rust_name = "my_rust_name"`
173
+
- Specifies an alternative name to use on the rust side, applying to the property name as well as autogenerated functions
0 commit comments