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

Make tuner inputs accept fractional numbers only in "C" format #636

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

wawuwo
Copy link
Contributor

@wawuwo wawuwo commented Mar 9, 2024

Hi! This is a quick fix of #416 based on a solution offered in this comment

Recap of the problem:
Input fields on tuner form use QDoubleValidators which by default operate in user's native locale. But unfortunately some other parts of tuner codebase are not locale-aware, which leads to bugs if user's native locale number formatting differs from that in "C".

This PR makes tuner inputs unaware about native locale and use "C" instead, i.e. accept fractional numbers only if

  • dot is integral/fractional part separator
  • there is no group separators in number

Scientific notation is still accepted.

Input fields on tuner form use QDoubleValidators which by default
operate in user's native locale. But unfortunately some other
parts of tuner codebase are not locale-aware, which leads to bugs
if user's native locale number formatting differs from that in "C".

This commit makes tuner inputs native locale unaware, i.e. accept
fractional numbers only if
 - dot is integral/fractional part separator
 - there is no group separators in number

Scientific notation is accepted.

Fixes ra3xdh#416
@ra3xdh ra3xdh linked an issue Mar 9, 2024 that may be closed by this pull request
@ra3xdh ra3xdh merged commit 8dfadff into ra3xdh:current Mar 11, 2024
2 checks passed
@ra3xdh
Copy link
Owner

ra3xdh commented Mar 11, 2024

Thanks for providing fix! Merged.

@wawuwo wawuwo deleted the 416-c-locale-for-tuner-number-inputs branch March 14, 2024 18:18
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.

Qucs-S 24.1-7df03e9 - Yet Another Tuner Slider Bug
2 participants