-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix issues for multiediting and updating for attribute form with more widgets pointing to the same field #50410
Conversation
Merging this one should be deferred till after release -- touching this particular code introduces a nuclear level risk of regression 😱 |
@domi4484 could you leave some notes about what was wrong and how this PR improves the situation? |
@m-kuhn yes I added some. @nyalldawson i hope this will be a small step making this code more predictable. If this doesn't show any regression do you think it will be possible to backport it? |
This is something we'd need to land in upcoming LTR. I see two approaches:
I am not sure what is best. The sooner before it gets flagged as LTR sounds good, but just a bit of testing in master before might be worth (although it's not bullet-proof, especially just right after the release). |
If possible, I'd like to see this land in 3.28.x LTR. I'll be available to help testing. Both of Denis proposals would work for me - perhaps the sooner the better. People don't expect a .0 release to be production ready and it isn't yet labeled as LTR with 3.28.0 |
This would be my vote. (Specifically backport for 3.28.1) |
I'm happy with this approach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me -- could we add an additional test case that covers the scenario being fixed here? Other than that, +1 to merge.
@nirvn thanks I have added one test for it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for the test (I've ran it against master and it does fail, which is perfect :) ).
Fix #50197 Multiedit not working correctly when multiple widgets are available for the same field, and at the same time reduce the usage of signals/slots logic inside the attribute form.
In the attribute form there can be multiple widgets for the same field. But the dependency widget -> field was stored as a map with field as key. It means only the last added widget was stored in the map. The updating of the values was done with a signal/slot connection between
valuesChanged()
andsetValues()
of all widgets sharing the field.I changed that using a multi map and thus storing all widgets pointing to a field in a variable. When a field value is changed the values of the same field widgets are set explicitly by looking in the map if thre are other to update.
This probably solves other unreported issues where in functions
onConstraintStatusChanged
andsynchronizeState
only the last added widget was updated.