You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `impl cxx_qt::Initialize for x {}` can now be written in the bridge as shorthand
- It is shorthand for `impl cxx_qt::Constructor<()> for x {}`
- Update book and docs
-[Initialize](https://docs.rs/cxx-qt/latest/cxx_qt/trait.Initialize.html) - execute Rust code when the object is constructed
27
+
-[Initialize](https://docs.rs/cxx-qt/latest/cxx_qt/trait.Initialize.html) - execute Rust code when the object is constructed, or as shorthand for an empty constructor
28
28
-[Threading](https://docs.rs/cxx-qt/latest/cxx_qt/trait.Threading.html) - marker trait whether CXX-Qt threading should be enabled
29
29
30
30
> ⚠️ These traits should only be implemented if you are sure you need to, they are automatically implemented for RustQt types.
Copy file name to clipboardExpand all lines: crates/cxx-qt/src/lib.rs
+4
Original file line number
Diff line number
Diff line change
@@ -313,6 +313,7 @@ impl<T: Sized> Downcast for T {}
313
313
/// To reduce the boilerplate of this use-case, CXX-Qt provides the [Initialize] trait.
314
314
///
315
315
/// If a QObject implements the `Initialize` trait, and the inner Rust struct is [Default]-constructible it will automatically implement `cxx_qt::Constructor<()>`.
316
+
/// Additionally, implementing `impl cxx_qt::Initialize` will act as shorthand for `cxx_qt::Constructor<()>`.
316
317
pubtraitConstructor<Arguments>:CxxQtType{
317
318
/// The arguments that are passed to the [`new()`](Self::new) function to construct the inner Rust struct.
0 commit comments