Skip to content
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

Merged
merged 2 commits into from
Jul 13, 2021

Conversation

ratijas
Copy link
Collaborator

@ratijas ratijas commented Jul 10, 2021

Sir, one review for me please

one review 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

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
@ratijas ratijas added A-wrappers Area: Wrappers and bindings C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: documentation for any part of the projects S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 10, 2021
@ratijas ratijas requested a review from ogoffart July 10, 2021 14:34
@ratijas
Copy link
Collaborator Author

ratijas commented Jul 10, 2021

@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.

Copy link
Member

@ogoffart ogoffart left a 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.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ratijas ratijas added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 12, 2021
* 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.
@ratijas
Copy link
Collaborator Author

ratijas commented Jul 12, 2021

Maybe the tutorial should be in a different .md file linked from the README

Shhhh!.. 🤫
It is part of a secret Project M no one should know about.

@ratijas ratijas added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 12, 2021
@ratijas ratijas merged commit 23566d2 into woboq:master Jul 13, 2021
@ratijas ratijas deleted the tutorial-add-wrappers branch July 13, 2021 07:41
@ratijas ratijas removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the projects A-wrappers Area: Wrappers and bindings C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't compile simple example
2 participants