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

Consider when to use an equality comparison in the setter files for QProperty #1000

Open
BenFordTytherington opened this issue Jul 22, 2024 · 3 comments

Comments

@BenFordTytherington
Copy link
Collaborator

In the rust setter file, the following check is used

if self.#ident == value {

which may be extra unnecessary overhead and could be optimised?

@ahayzen-kdab
Copy link
Collaborator

If there is no NOTIFY for this qproperty do we want/need to compare if the value is the same, as we do not need to determine if we notify or not

@LeonMatthesKDAB
Copy link
Collaborator

Also, the type may not even have an Eq implementation. Can we detect that somehow?

@ahayzen-kdab
Copy link
Collaborator

Right at the moment when you have an auto generated setter and notify, we assume your type implements Eq and we ensure that we don't trigger notify when data doesn't change. If your type didn't implement Eq at least now you could write a custom setter :-)

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

No branches or pull requests

3 participants