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 std::cmp::PartialEq for all Qt types #413

Merged
merged 3 commits into from
Jan 13, 2023
Merged

Conversation

vimpostor
Copy link
Member

@vimpostor vimpostor commented Jan 13, 2023

This also allows us to trigger changed() signals only when the value really changed.

After this we can also implement std::cmp::PartialOrd for selected types, but it does not make sense for all types (e.g. not for QByteArray)

See #53

Looks like cargo fmt ruined the formatting on this one by accident.
For some types we can simply derive from PartialEq.
In all other cases we piggyback on the Qt equality operator at the C++
side via a template interface.

This unblocks KDAB#372
This avoids binding loops.

Also add a new unit test to check for this behaviour.

Fixes KDAB#372
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.

Awesome 🥳 LGTM :-)

@ahayzen-kdab ahayzen-kdab merged commit 1d09e7b into KDAB:main Jan 13, 2023
@vimpostor vimpostor deleted the eq branch January 18, 2023 11:36
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.

2 participants