impl on MyObjectCpp #156
Replies: 4 comments 10 replies
-
So when implementing this in #159 it has been found that to use a Options appear to be
What would this look like ? Modules#[cxx_qt::bridge]
mod ffi {
mod qt {
...
}
} or #[cxx_qt::bridge]
mod ffi {
#[qt]
mod gen {
...
}
} Function macrocxx_qt::bridge!(
mod ffi {
extern "Qt" {
...
}
}
); or cxx_qt::bridge!(
#[cxx::bridge]
mod ffi {
extern "Qt" {
...
}
}
); or cxx_qt::bridge!(
extern "Qt" {
...
}
); |
Beta Was this translation helpful? Give feedback.
-
Side note: But we were also discussing something like |
Beta Was this translation helpful? Give feedback.
-
So if there were existing attributes on the module where do they go ? eg if i had
Do they go onto the CXX mod or onto the cxx_qt one ? or do we just not allow this ? |
Beta Was this translation helpful? Give feedback.
-
@LeonMatthesKDAB did we have a plan for locking related to the |
Beta Was this translation helpful? Give feedback.
-
As discussed in #149, we probably don't want to impl everything on RustObj, as that doesn't have access to C++ methods, like emit.
Therefore, we actually want to impl on some kind of "rich pointer" that has access to both Rust & C++.
For this, why not implement on the MyObjectCpp. We could use a Qt for syntactic sugar to make this more explicit.
Example code:
Which would then generate:
This actually compiles and works as a proper QObject.
EDITED: Removed
extern "Qt"
syntax.This wasn't possible to parse with our procedural macro.
Beta Was this translation helpful? Give feedback.
All reactions