Unsolved Using decimal point separator on french OS
-
Hi
I have a TextInput component with the validator set to DoubleValidator.
On my PC the decimal separator is the coma (,) but I need the point (.) as decimal separator independly in which country the application is running.
How can I do that?
Thank you -
I have never tried it myself. However,
QValidator
has a methodsetLocale()
. This sets how the input should be interpreted. Most likely you are looking forQLocale::C
which only support the point and not the comma (at least as decimal separator). Though by default locales allow for group separators. So, you might want to get a copy of the C locale object and adjust theQLocale::NumberOptions
accordingly.Let me know if this approach works.