Michael-F-Bryan / rust-ffi-guide

A guide for doing FFI using Rust
https://michael-f-bryan.github.io/rust-ffi-guide/
Creative Commons Zero v1.0 Universal
282 stars 18 forks source link

Fixups to chapter 11 #62

Closed kossebau closed 6 years ago

kossebau commented 6 years ago

And now walked through chapter 11 as well, as far as available. Again tried to collect all code issues which I assume you did not leave in for educational reasons? :) BTW, collections in all review requests might be incomplete, I did not rewalk the tutorial with the updated notes, only tried to note things while I found them.

Given the TODO in chapter 11, about the UI for selecting a plugin and my years of experience with Qt (while none with Rust): would you be interested in me giving that TODO a try, at least for the Qt side of things?

Michael-F-Bryan commented 6 years ago

would you be interested in me giving that TODO a try, at least for the Qt side of things?

Yep, I'm more than happy to let you have a go at it. I wasn't very sure how to approach it so I left it for later. Just clarifying, you mean the TODO just before the Lets Make A Plugin section, don't you?

The TODOs about proper error handling should be resolved when I finish off #59.

kossebau commented 6 years ago

would you be interested in me giving that TODO a try, at least for the Qt side of things?

Yep, I'm more than happy to let you have a go at it. I wasn't very sure how to approach it so I left it for later. Just clarifying, you mean the TODO just before the Lets Make A Plugin section, don't you?

Ah, missed a comma there, yes, meant the "TODO: Once the main UI is done, step through adding a "load plugin" button and hooking it up to the plugin manager.".

Okay, will give that a try during this week.

kossebau commented 6 years ago

I looked at little into it, but in the end I agree to your TODO comments, for delaying further work on the UI code snippets in the tutorial until it is clear what the final ui design of the window should be like. E.g. if perhaps there should be some log display of the send/received messages instead of printing to stdout, and so on.

But once there is an idea, I am happy to contribute with my Qt experience. So please consider pinging me then.

For now I took what I learned here and already built onto it. e.g. by starting an mdbook with the tutorials on the Rust Qt Binding Generator as developed here: https://cgit.kde.org/rust-qt-binding-generator.git/about/ :)

So the patch for chapter 11 here is complete for now and for you to be reviewed.

Michael-F-Bryan commented 6 years ago

It all looks pretty good to me. Thanks for picking up on the overload in MainWindow::closeEvent(), I completely missed the fact that you'll often upcast to a parent class and therefore need overload so you have the right vtable.