KDAB / cxx-qt

Safe interop between Rust and Qt
https://kdab.github.io/cxx-qt/book/
1.03k stars 68 forks source link

Support documenting the generated C++ code #636

Open LeonMatthesKDAB opened 1 year ago

LeonMatthesKDAB commented 1 year ago

We should consider supporting user documentation on the generated C++.

So if someone writes:

#[cxx_qt::bridge]
mod qobject {
    extern "RustQt" {
         /// A documentation comment
         #[qinvokable]
         fn my_invokable(self: &MyObject);   
    }
}

The A documentation comment should be exported as a Doxygen-compatible documentation comment into the generated C++ code.

ahayzen-kdab commented 1 year ago

Note that we would need to search for any #[doc = "..."] attributes on existing syn blocks then apply these to the generated C++ code.

LeonMatthesKDAB commented 1 year ago

Also questionable what to do for a documentation on a #[qsignal], as that's then declared both in C++, as well as Rust. Should that show up in both C++ and Rust? Then what does Rust end up doing with the @arg tags, etc.?

BenFordTytherington commented 3 weeks ago

Potentially partially implemented in #1054