Summary: | PATCH WIP: Add moveable objects | ||
---|---|---|---|
Product: | [Developer tools] rust-qt-binding-generator | Reporter: | kdebuac.rhn |
Component: | general | Assignee: | Jos van den Oever <jos> |
Status: | CONFIRMED --- | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | The WIP patch |
Description
kdebuac.rhn
2018-08-02 20:33:16 UTC
Making the object optional is one option. The other option is to require that the object implements the Default trait. Implying that the object is optional is bad in my opinion. If the the first of the two alternatives is chosen, it should require that the binding JSON explicitly contains '"optional": true'. Can you say a bit more about 'creating objects on the fly'? I chose to make optional implicit because I was concerned with the QML use case, where the object can be almost arbitrary, but is immediately replaced. I think making optional explicit is not a bad choice. While this patch covers only the case of optional==True, it's self-contained and can be a starting point for optional==False support implemented as a separate change. By "creating objects on the fly", I meant creating QML objects (e.g. list items) in Rust. I have prototyped it a bit and have an idea of how to proceed. It's unrelated to this change, but I could start a separate bug to elaborate. Please upload the patch to code review so we can discuss it in detail. https://phabricator.kde.org/differential/diff/create/ Here it is: https://phabricator.kde.org/D14634 |