Skip to content

Commit

Permalink
cxx-qt: export static assertions for cxx-qt-gen
Browse files Browse the repository at this point in the history
This allows for CxxQtSignalHandler to have it's size and align
checked by cxx-qt-gen.
  • Loading branch information
ahayzen-kdab committed Oct 3, 2023
1 parent 25a71a4 commit 242066e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/cxx-qt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions crates/cxx-qt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 242066e

Please sign in to comment.