-
Notifications
You must be signed in to change notification settings - Fork 80
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
Implement automatic implementations of up and downcasting #1159
base: main
Are you sure you want to change the base?
Implement automatic implementations of up and downcasting #1159
Conversation
fb6ec2a
to
afe4181
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1159 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 71 71
Lines 11882 11955 +73
=========================================
+ Hits 11882 11955 +73 ☔ View full report in Codecov by Sentry. |
f3b9070
to
87b9d5a
Compare
extern "C++" { | ||
#[doc(hidden)] | ||
#[namespace=""] | ||
type QObject = cxx_qt::qobject::QObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if you have the same type twice in CXX 🤔 as wondering if the developer would ever write type QObject
themselves too ...
.cloned() | ||
.unwrap_or( | ||
Name::new(format_ident!("QObject")).with_module(parse_quote! {::cxx_qt::qobject}), | ||
); // TODO! is this default module here causing the issues in the threading examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still a problem? or did you solve it?
use std::{fs::File, io::Write, path::Path}; | ||
|
||
mod connection; | ||
mod connectionguard; | ||
pub mod qobject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want developers to go cxx_qt::qobject::QObject
or cxx_qt::QObject
? At the moment for cxx-qt-lib everything is in the root module, but we wondered if they should be split by core/gui/quick etc, wonder what we do here?
#[cxx::bridge] | ||
mod ffi { | ||
unsafe extern "C++" { | ||
// TODO! Implement QObject wrapper properly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right and then we reach the QObject::thread() -> QThread
method, which @LeonMatthesKDAB might help with that threading idea :-)
- Any bridges with qobjects that have no custom base class will get an upcasting implemention - Adds a new include with the necessary template function for calling static_cast
87b9d5a
to
6b8d457
Compare
No description provided.