Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement automatic implementations of up and downcasting #1159

Merged
merged 6 commits into from
Feb 28, 2025

Conversation

BenFordTytherington
Copy link
Collaborator

No description provided.

@BenFordTytherington BenFordTytherington force-pushed the add-up-down-casting branch 4 times, most recently from fb6ec2a to afe4181 Compare January 16, 2025 17:51
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (bd0fbc7) to head (db8d215).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1159   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           73        73           
  Lines        12458     12527   +69     
=========================================
+ Hits         12458     12527   +69     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BenFordTytherington BenFordTytherington force-pushed the add-up-down-casting branch 2 times, most recently from f3b9070 to 87b9d5a Compare February 3, 2025 13:54
@BenFordTytherington BenFordTytherington marked this pull request as ready for review February 3, 2025 14:08
@BenFordTytherington BenFordTytherington force-pushed the add-up-down-casting branch 2 times, most recently from 6b8d457 to 2786e90 Compare February 7, 2025 10:25
@BenFordTytherington BenFordTytherington force-pushed the add-up-down-casting branch 2 times, most recently from 6578b6b to c60cdfe Compare February 7, 2025 17:24
@BenFordTytherington BenFordTytherington force-pushed the add-up-down-casting branch 4 times, most recently from ba5808c to a08b918 Compare February 14, 2025 12:38
@BenFordTytherington BenFordTytherington force-pushed the add-up-down-casting branch 4 times, most recently from 13da0be to 9ea2336 Compare February 14, 2025 16:04
Copy link
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.

Overall looks good, would be nice in a future PR to add support for #[base = T] to extern "C++Qt" types too so we can do the same tricks of up/down casting there

@BenFordTytherington BenFordTytherington force-pushed the add-up-down-casting branch 3 times, most recently from 8979b03 to 55eb426 Compare February 21, 2025 16:12
ahayzen-kdab
ahayzen-kdab previously approved these changes Feb 21, 2025
Copy link
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.

Looks good :-) @LeonMatthesKDAB any comments ? Ben is going to look at further changes like adding more docs to the book / adding support for base to extern C++Qt so that casing can be done on those types.

But i think this is probably far enough to land this part already?

Copy link
Collaborator

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Choose a reason for hiding this comment

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

Only some nitpicks left from my side.

Feel free to merge after these and the comments from @ahayzen-kdab are fixed.
Another really good step forward! 🥳

- Any bridges with qobjects that have no custom base class will get an upcasting implemention
- Adds a new include with the necessary template function for calling static_cast
@BenFordTytherington BenFordTytherington force-pushed the add-up-down-casting branch 2 times, most recently from 71ce3ca to 0d46b6e Compare February 28, 2025 10:42
Copy link
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, support for C++Qt will be in another change and extending the QObject type etc. @LeonMatthesKDAB any objections ?

@ahayzen-kdab
Copy link
Collaborator

(Leon says it's good too)

@ahayzen-kdab ahayzen-kdab merged commit ed8552b into KDAB:main Feb 28, 2025
16 checks passed
@BenFordTytherington BenFordTytherington deleted the add-up-down-casting branch February 28, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants