Skip to content

qtypes: add support for Qt alias types that don't match #904

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

Merged
merged 3 commits into from
Jan 29, 2025

Conversation

ahayzen-kdab
Copy link
Collaborator

Closes #882

Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a98b1b8) to head (741741f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #904   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           71        71           
  Lines        11967     11967           
=========================================
  Hits         11967     11967           

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

@ahayzen-kdab ahayzen-kdab force-pushed the 882-add-qtypes branch 2 times, most recently from debf9b7 to 79cc8fe Compare October 11, 2024 10:49
@ahayzen-kdab ahayzen-kdab force-pushed the 882-add-qtypes branch 3 times, most recently from 6a21207 to c67af09 Compare October 11, 2024 14:27
@ahayzen-kdab ahayzen-kdab marked this pull request as ready for review October 11, 2024 14:29
@ahayzen-kdab ahayzen-kdab changed the title WIP: qtypes: add support for Qt alias types that don't match qtypes: add support for Qt alias types that don't match Oct 11, 2024
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.

Overall this looks good.
Naming wise I would just copy Qts casing (so lowercase). These types are quiet "fundamental types", which even in Rust are lowercase (i64, isize, etc.).

A sort-off open question is still how many operations we want to support on these...
Do we basically just enable From/Into and call it a day, or do we want to have support for using the type more directly, like support for +-*/ on qint64...

For now it's probably good enough if we just have them convertable to their inner type, but something to keep in mind.

On the same note: Maybe we don't want to support Deref on these types?
It may be weird if you call e.g. abs on qint64, but get an i64 back...
And now it would be a breaking change for us to add our own abs method that returns qint64...

So it seems like limiting the API to just From/To with some derives is maybe best?

@ahayzen-kdab ahayzen-kdab force-pushed the 882-add-qtypes branch 3 times, most recently from f2bf8e6 to 91759c2 Compare November 5, 2024 17:48
LeonMatthesKDAB
LeonMatthesKDAB previously approved these changes Dec 6, 2024
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.

Re-approved after rebase

@LeonMatthesKDAB LeonMatthesKDAB enabled auto-merge (squash) January 29, 2025 09:42
@LeonMatthesKDAB LeonMatthesKDAB merged commit cdc5ef9 into KDAB:main Jan 29, 2025
16 checks passed
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.

Add qsizetype to cxx-qt crate
3 participants