Conversation
tronical
left a comment
There was a problem hiding this comment.
Looks good overall. I'm mostly concerned about the documentation, as you can see in the comments ;)
| /// The `StrongHandle` trait is implemented for each global. | ||
| /// It marks this component as holding a strong reference to the Slint element tree | ||
| /// and allows using this component with a Weak reference. | ||
| impl StrongHandle for SampleGlobal<'static> { |
There was a problem hiding this comment.
I'm curious, why is it important to show that this trait is implemented? Users should never call a function on the trait, right?
There was a problem hiding this comment.
There was a problem hiding this comment.
Maybe I can phrase this differently: If we document this trait, it needs to be documented in a way that conveys to the users what they can do with it, how it relates to the rest of the API.
It is important because that is what enables it to be stored in a Weak
Why is this important to me as a user of the API? What does "enabling" me for me as a user?
(I'm asking because whatever the answer is, it would most likely belong into the docs :-)
and it shows up as the first part of the Weak documentation.
I think it's not uncommon to have internal traits be visible in bounds, etc. but keep the hidden.
There was a problem hiding this comment.
Ok, we discussed this on the train ride to Nürnberg and Leon convinced me that the way it's documented now is okay to have. We're not exactly promoting this trait, after all :)
There was a problem hiding this comment.
As discussed I'll still reword it a little bit though. Can do that today.
1bc64c0 to
ec0965f
Compare
The idea to make it easier and more convenient to pass a reference to a Slint global instance into a Rust closure / lambda. Fixes #9389
ec0965f to
73c56f0
Compare
Based on feedback by @tronical, add examples of incorrect/correct usage and a section about common issues.

No description provided.