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

Explicitly set the QLocale in the GUI #603

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Conversation

MBartkowiakSTFC
Copy link
Collaborator

Description of work
The number format will always follow the British convention, where "1 point 0" is 1.0 and not 1,0 or anything else.

closes #595

Fixes

  1. Created a QLocale instance set to English, UK, before starting the GUI.

To test
On a platform already set to English, there should be no difference.
On platforms using different symbols for the decimal point, the MDANSE GUI should now accept the '.' character instead.

@ChiCheng45
Copy link
Collaborator

I've tested this on a German Windows 11 VM and this change allows me to use '.' characters as the decimal point.

One problem I can see is if they use ',' as the decimal point then QT converts it to a different number e.g.

1,3 -> 1.3E+01

This might be confusing to new users. What do you think about disabling the use of commas altogether?

@MBartkowiakSTFC
Copy link
Collaborator Author

Unfortunately, commas are allowed in English number formatting, as in "1,000,000.05" so a normal QDoubleValidator will not remove them. But you are right, they should be disabled.

@MBartkowiakSTFC
Copy link
Collaborator Author

As far as I can tell, this should work now.

Copy link
Collaborator

@ChiCheng45 ChiCheng45 left a comment

Choose a reason for hiding this comment

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

Looks good.

@ChiCheng45 ChiCheng45 merged commit 9d4cf6d into protos Nov 20, 2024
28 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.

[BUG] German Keyboard GUI Problem
2 participants