-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilizing 1.0 API #555
Comments
From #584, for auto generated getter/setter should of properties should they always be pub methods ? Then if the developer wants something different they can use the custom getter/setter? I think this makes sense but just wanted to check if we need any more changes in the API, but seems likely not. Original comments
|
Does
As we need to be able to support making an override on just a C++ method and not a qinvokable as well ? eg #298 |
I think that makes sense, yes. |
Is the following code legacy/deprecated? Should I use #[cxx_qt::qobject]
pub struct FooBar {
#[qproperty]
number: i32,
#[qproperty]
string: QString,
}
// ...
impl qobject::FooBar {
#[qinvokable]
pub fn increment_number(self: Pin<&mut Self>) {
let previous = *self.as_ref().number();
self.set_number(previous + 1);
}
#[qinvokable]
pub fn say_hi(&self, string: &QString, number: i32) {
println!("Hi from Rust! String is '{string}' and number is {number}");
}
} |
Hi @axelkar , happy to hear you're interested in CXX-Qt. The core concepts of CXX-Qt are not going to change. However the API will be different and a lot closer to CXX. In our opinion, the new API is ever so slightly more verbose, but it should make the aim of CXX-Qt much clearer. We're always looking for feedback, so please feel free to leave any thoughts, concerns and suggestions under this issue 😊 |
Regarding your second question:
So to include the header file for the qobject generated by #include <cxx-qt-gen/qobject.cxxqt.h> As the |
We need to figure out a plan for QFlags maybe something with https://crates.io/crates/bitflags and https://crates.io/crates/flagset etc |
After discussions following #531, we believe we've found an improved API that we want to target for Cxx-Qt 1.0.
Anyone using Cxx-Qt, feel free to leave feedback on this issue.
Solved API problems
extern "Qt"
- allow signals on existing Qt classes #527 -extern "Qt"
block &extern "RustQt"
blockDrawbacks
1.0 API Overview
The point of this API is to be even closer to CXX than before, by only putting declarations within the bridge itself.
We've found this preferable for
#[inherit]
, as well as for#[qsignal]
for a while now, but haven't found a good API for QProperty.We believe by simply using a
#[qproperty()]
attribute this can be solved nicely!The text was updated successfully, but these errors were encountered: