bridge

Attribute Macro bridge 

Source
#[bridge]
Expand description

A procedural macro which generates a QObject for a struct inside a module.

ยงExample

#[cxx_qt::bridge(namespace = "cxx_qt::my_object")]
mod qobject {
    extern "RustQt" {
        #[qobject]
        type MyObject = super::MyObjectRust;

        #[qinvokable]
        fn invokable(self: &MyObject, a: i32, b: i32) -> i32;
    }
}

#[derive(Default)]
pub struct MyObjectRust;

impl qobject::MyObject {
    fn invokable(&self, a: i32, b: i32) -> i32 {
        a + b
    }
}