diff --git a/crates/cxx-qt/Cargo.toml b/crates/cxx-qt/Cargo.toml index 84abff57e..463442fa4 100644 --- a/crates/cxx-qt/Cargo.toml +++ b/crates/cxx-qt/Cargo.toml @@ -20,6 +20,7 @@ categories = ["api-bindings", "gui"] [dependencies] cxx.workspace = true cxx-qt-macro.workspace = true +static_assertions = "1.1.0" [dev-dependencies] cxx.workspace = true diff --git a/crates/cxx-qt/src/lib.rs b/crates/cxx-qt/src/lib.rs index 4614de801..72272da03 100644 --- a/crates/cxx-qt/src/lib.rs +++ b/crates/cxx-qt/src/lib.rs @@ -18,6 +18,11 @@ pub use cxx_qt_macro::qobject; pub use cxxqtsignalhandler::{CxxQtSignalHandler, CxxQtSignalHandlerClosure}; pub use cxxqtthread::CxxQtThread; +// Export static assertions that can then be used in cxx-qt-gen generation +// +// These are currently used to ensure that CxxQtSignalHandler has the right size +pub use static_assertions::{assert_eq_align, assert_eq_size}; + /// This trait is automatically implemented for all types which are marked as `#[qobject]`. /// It provides information about the type that is wrapped by the QObject, as well as the methods /// that Cxx-Qt will generate for the QObject.