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

38063 sample transmission calculators DoubleSpinBoxes avoid commas #38247

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

warunawickramasingha
Copy link
Contributor

@warunawickramasingha warunawickramasingha commented Oct 21, 2024

Description of work

Under Single wavelength mode, the spin boxes for Low, Width, and High in the Sample Transmission Calculator interface had allowed its spin boxes to enter values such as 0,2.1 to include a blend of commas and decimal dot and this work is to avoid that.

In addition, this includes fixing two coverity issues in RotateSampleShape.cpp

Summary of work

Fixes #38063.

Further detail of work

To test:

  1. Open the Sample Transmission Calculator interface from (Interfaces > General > Sample Transmission Calculator)
  2. Enter a value containing comma in the DoubleSpinBoxes for any of Low, Width, and High fields ex: 2,3
  3. The moment when the number following the comma is entered the the comma should be converted to a decimal dot.
  4. Try entering different combinations of dot and comma and the same should be observed as in step 3

Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@warunawickramasingha warunawickramasingha added Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Maintenance Unassigned issues to be addressed in the next maintenance period. labels Oct 21, 2024
@warunawickramasingha warunawickramasingha added this to the Release 6.12 milestone Oct 21, 2024
Copy link
Contributor

@RichardWaiteSTFC RichardWaiteSTFC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this.
I had a quick play around and it does seem to behave slightly differently when you use , instead of . - say I want to set a value of 1.35, if I type 1,35 the spin box is updated to 1.3 (i.e. misses the last digit). I wonder if that's because it editing mode if changed? can you reproduce this?

Could you try validating/cleaning the input after this slot instead (from the base class)?
https://doc.qt.io/qt-6/qabstractspinbox.html#editingFinished
It might not work...

@RichardWaiteSTFC
Copy link
Contributor

Also thanks for fixing the coverity issues on RotateSampleShape - I'm happy not to do these minor changes in a separate PR if the gatekeepers agree!

@warunawickramasingha
Copy link
Contributor Author

Thanks for this. I had a quick play around and it does seem to behave slightly differently when you use , instead of . - say I want to set a value of 1.35, if I type 1,35 the spin box is updated to 1.3 (i.e. misses the last digit). I wonder if that's because it editing mode if changed? can you reproduce this?

Could you try validating/cleaning the input after this slot instead (from the base class)? https://doc.qt.io/qt-6/qabstractspinbox.html#editingFinished It might not work...

Thanks for the review! After observing that handling with editingFinished signal does not do the job, I have used lineEdit().setText() method to fix this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Maintenance Unassigned issues to be addressed in the next maintenance period.
Projects
Status: Waiting response
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

Spin boxes in Sample Transmission Calculator allows typing comma
2 participants