Skip to content

Generate container element trait implementations inside bridge blocksΒ #1303

@jnbooth

Description

@jnbooth

It would be convenient if instead of needing all those generate.sh scripts, you could do something like this:

#[cxx_qt::bridge]
mod ffi {
  extern "C++" {
    type MyType = super::MyType;
  }

  impl QList<MyType> {
    type TypeId = type_id!("QList_MyType");
  }
}

Then it would generate the C++ and Rust code automatically. Note that I'm using the syntax impl QList<MyType> rather than impl QListElement for MyType to match the style of cxx's shim trait impls. I've been playing around with cxx-qt-gen and would be interested in taking a stab at this, if other people think it would be a good idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions