Add support for pure virtual methods #1179
Labels
🤔 discussion
Feedback welcome
⬆️ feature
New feature or request
🥳🎉 1.0
This issue is part of stabilization for 1.0 release
We should allow for defining pure virtual methods on RustQt types.
This allows for then creating an abstract QObject and implementing concrete types, for example this is useful when having a real vs mock implementation for testing (this is useful when you have an interface that talks to hardware, over a network socket, to an input device, etc).
In C++ this looks like the following
To represent this in Rust we could use
#[cxx_pure_virtual]
or combing multiple attributes so one is forvirtual
and one is for the= 0
?Once we support this the multi crate example could be a good place to have an example of one crate with an abstract/real/mock implementation and another crate using the abstract version as the type in properties/invokables, as a real world example.
The text was updated successfully, but these errors were encountered: