Skip to content

cxx-qt: Add CxxQtType trait#551

Merged
ahayzen-kdab merged 1 commit intoKDAB:mainfrom
LeonMatthesKDAB:qtobject-trait
May 31, 2023
Merged

cxx-qt: Add CxxQtType trait#551
ahayzen-kdab merged 1 commit intoKDAB:mainfrom
LeonMatthesKDAB:qtobject-trait

Conversation

@LeonMatthesKDAB
Copy link
Copy Markdown

This trait is automatically implemented on any qobject::T. It currently exposes the inner Rust type for a given QObject.

First step of implementing #550

This also requires us to split our macros into a cxx-qt-macro crate, as otherwise only exporting proc-macros is allowed.
We could now potentially move CxxQtThread into the cxx-qt crate now to remove the dependency on cxx-qt-lib.

Comment thread Cargo.toml
@LeonMatthesKDAB LeonMatthesKDAB force-pushed the qtobject-trait branch 6 times, most recently from fa1df00 to 86b25c8 Compare May 30, 2023 07:04
@LeonMatthesKDAB LeonMatthesKDAB changed the title cxx-qt: Add a QtObject trait cxx-qt: Add CxxQtType trait May 30, 2023
@LeonMatthesKDAB LeonMatthesKDAB added ⬆️ feature New feature or request 🥳🎉 1.0 This issue is part of stabilization for 1.0 release 📖 documentation Improvements or additions to documentation labels May 30, 2023
Comment thread crates/cxx-qt-gen/src/writer/rust/mod.rs Outdated
@LeonMatthesKDAB LeonMatthesKDAB force-pushed the qtobject-trait branch 2 times, most recently from 6656177 to bb03423 Compare May 30, 2023 15:39
@ahayzen-kdab
Copy link
Copy Markdown
Collaborator

Just needs rebasing, then looks good :-)

Allows the type system to reason about the inner type of a given CXX-Qt
QObject.
Also cleanly documents where `rust` and `rust_mut` come from.
Copy link
Copy Markdown
Collaborator

@ahayzen-kdab ahayzen-kdab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ahayzen-kdab ahayzen-kdab enabled auto-merge (rebase) May 31, 2023 10:07
@ahayzen-kdab ahayzen-kdab merged commit 726b895 into KDAB:main May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 documentation Improvements or additions to documentation ⬆️ feature New feature or request 🥳🎉 1.0 This issue is part of stabilization for 1.0 release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants