Bridge module without QObject type #1032
-
Hi there, I'm finding that cxx-qt does not seem to allow defining a bridge module that does not have a Am I missing something? Example: #[cxx_qt::bridge(cxx_file_stem = "shoop_rust_callable")]
pub mod ffi {
unsafe extern "C++" {
include!("cxx-qt-lib/qvariant.h");
type QVariant = cxx_qt_lib::QVariant;
}
unsafe extern "C++" {
include!("cxx-qt-shoop/shoop_rust_callable.h");
type ShoopRustCallable = type_shoop_rust_callable::ShoopRustCallableRust;
#[rust_name = "qvariant_can_convert_shoop_rust_callable"]
fn qvariantCanConvertShoopRustCallable(variant: &QVariant) -> bool;
#[rust_name = "register_metatype_shoop_rust_callable"]
fn registerMetatypeShoopRustCallable(name : &mut String);
}
#[namespace = "rust::cxxqtlib1::qvariant"]
unsafe extern "C++" {
include!("cxx-qt-lib/qvariant.h");
#[rust_name = "qvariant_construct_shoop_rust_callable"]
fn qvariantConstruct(value: &ShoopRustCallable) -> QVariant;
#[rust_name = "qvariant_value_or_default_shoop_rust_callable"]
fn qvariantValueOrDefault(variant: &QVariant) -> ShoopRustCallable;
}
extern "RustQt" {
#[qobject]
type Dummy= super::DummyRust;
}
}
use ffi::*;
#[derive(Default)]
pub struct DummyRust {}
(...) This works, but fails as soon as the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This sounds like a bug :-) we probably assume that any rust file that is given to CxxQtBuilder than has a As a workaround note you can use Lets convert this to an issue to investigate the original issue though. |
Beta Was this translation helpful? Give feedback.
Created #1033