-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Add support for attributes to #[qproperty] #451
Conversation
@@ -33,6 +33,7 @@ impl GeneratedRustQObjectBlocks { | |||
} | |||
} | |||
|
|||
#[derive(Debug)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reasoning for these extra derive Debug's ? They could be done in a separate commit if they are useful ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly for debugging, I'll remove then
let default_setter = match property.set { | ||
Some(MaybeCustomFn::Default) => true, | ||
_ => false, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let default_setter = match property.set { | |
Some(MaybeCustomFn::Default) => true, | |
_ => false, | |
}; |
@@ -33,6 +33,7 @@ impl GeneratedRustQObjectBlocks { | |||
} | |||
} | |||
|
|||
#[derive(Debug)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly for debugging, I'll remove then
Also note the clippy warnings :-) |
@@ -4,15 +4,30 @@ | |||
// SPDX-License-Identifier: MIT OR Apache-2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to add an entry to the CHANGELOG.md :-)
And update anything in the book and we'll have to find somewhere in the properties example of qml_features to use it
Make it possible to define if only a getter should be generated or only a setter and/or define special getter and setter. Syntax is as follow ```rust struct MyObject { #[qproperty] prop1: f32, // generate default getter and setter #[qproperty(get)] prop2: f32, // generate default getter only #[qproperty(set)] prop3: f32, // generate default setter only #[qproperty(get = Self::prop4_fn)] prop4: f32, // use prop4_fn as getter } ``` WIP since the custom getter part doesn't work yet Signed-off-by: Carl Schwan <[email protected]>
a6171e2
to
3928c86
Compare
@@ -407,7 +407,7 @@ impl CxxQtBuilder { | |||
// Use a separate cc::Build for the little amount of code that needs to be linked with +whole-archive | |||
// to avoid bloating the binary. | |||
let mut cc_builder_whole_archive = cc::Build::new(); | |||
cc_builder_whole_archive.link_lib_modifier("+whole-archive"); | |||
//cc_builder_whole_archive.link_lib_modifier("+whole-archive"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//cc_builder_whole_archive.link_lib_modifier("+whole-archive"); |
remove before merging
@CarlSchwan good to see this change progressing nicely 👍 Quick chime-in on the The Or is there any way one could specify a getter/setter that is not on the |
I don't think there is a way to specify a getter/setter that is not on the But there are still quite some work needed to get there. |
IMHO, we should still just leave out the GTK-rs also seems to just use the function name. |
Superseded by #994 |
Make it possible to define if only a getter should be generated or only a setter and/or define special getter and setter.
Syntax is as follow
WIP since the custom getter part doesn't work yet