-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add tutorial on adding Rust wrappers for Qt C++ API #171
Conversation
Adds set_flag as a separate method on Graph struct, to extend the tutorial with fully usable wrapper and wrapper-specific documentation. Fixes potential compilation issue of Graph example: cpp! with #include was missing from main.rs, and the C++ code using QQuickItem accidentally worked, because of #include declared in cpp! inside another Rust file/module. But cpp crate does not specify in which order content of cpp! content between files, so it should not be relied on. Reorders #include lines in Graph example, such that external (Qt) stuff is on top, and local imports follow below. Resolves woboq#169
@dearkarm you are welcome to review too! What do you think? It would be nice to know whether such tutorial could've helped you on your adventure. |
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.
Thank you, this is great!
one thing maybe is that we want to emphasis that this should normaly not be needed.
Maybe the tutorial should be in a different .md file linked from the README instead of being dirrectly in the README, so we don't show in the README the scary cpp! macro for someone just browsing through.
* Rewords dependencies section, to nudge reader toward using published versions of qttypes. * Changes local path to explicitly absurd, to avoid assumptions that we are working from qmetaobject-rs subdirectory. * Removes "..." from features array, to make this line copy-pastable. * Comments out ... in appendSample function to avoid breaking Rust syntax (and make it copy-pastable too). * Formats qttypes cargo features comma-separated list of Qt modules into a table.
Shhhh!.. 🤫 |
Sir, one review for me please
I'm not sure about that last list of "This applies to the
following situations".
Adds set_flag as a separate method on Graph struct, to extend the
tutorial with fully usable wrapper and wrapper-specific documentation.
Fixes potential compilation issue of Graph example: cpp! with #include
was missing from main.rs, and the C++ code using QQuickItem
accidentally worked, because of #include declared in cpp! inside
another Rust file/module. But cpp crate does not specify in which order
content of cpp! content between files, so it should not be relied on.
Reorders #include lines in Graph example, such that external (Qt) stuff
is on top, and local imports follow below.
Resolves #169