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 Debug for all types that work with QDebug #1162

Merged
merged 9 commits into from
Feb 21, 2025

Conversation

jnbooth
Copy link
Contributor

@jnbooth jnbooth commented Jan 18, 2025

This PR adds Debug implementations to all types that a QDebug data stream accepts.

Note: Some types incorrectly used QDebug output to implement Display instead of Debug. This PR does not remove those implementations because that would be a breaking change, but they probably should be removed for the next major release.

@jnbooth jnbooth changed the title Debug and format Implement Debug for all types that work with QDebug Jan 18, 2025
@jnbooth jnbooth changed the title Implement Debug for all types that work with QDebug Implement Debug for all types that work with QDebug Jan 18, 2025
@jnbooth jnbooth changed the title Implement Debug for all types that work with QDebug Implement Debug for all types that work with QDebug Jan 18, 2025
Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (953bce3) to head (a28c1c7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1162   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           73        73           
  Lines        12446     12446           
=========================================
  Hits         12446     12446           

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

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.

Hi @jnbooth, thank you for this contribution!
It's great to see you're using CXX-Qt actively and I'm very happy to see the improvements that come out of it 😃

This PR mostly looks good. I believe it can be simplified a little bit more, as the toQString function should actually not be necessary anymore, and there are a few nitpicks to take care of.

Then we should be able to merge this 🥳

@LeonMatthesKDAB
Copy link
Collaborator

Hi @jnbooth sorry for the late reply.

I'm still in favor of accessing the toString function directly.
They're part of Qts public API so adding them in -lib by directly wrapping them is fine.
We can always add From/Into implementations in addition.
Once that is changed and rebased I can approve the PR :)

@jnbooth
Copy link
Contributor Author

jnbooth commented Feb 14, 2025

@LeonMatthesKDAB I've done that and merged in the latest changes, but now the tests seem to be broken and I don't know why...

@ahayzen-kdab
Copy link
Collaborator

Appears CI is still failing due to a clippy warning

error: function `qfont_to_debug_qstring` is never used
   --> crates/cxx-qt-lib/src/gui/qfont.rs:363:23
    |
363 |         #[rust_name = "qfont_to_debug_qstring"]
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D dead-code` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(dead_code)]`

@jnbooth
Copy link
Contributor Author

jnbooth commented Feb 21, 2025

@ahayzen-kdab Fixed!

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.

Thank you for the contribution @jnbooth 🚀

@LeonMatthesKDAB LeonMatthesKDAB merged commit be5fca7 into KDAB:main Feb 21, 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.

3 participants