Howto change settings in QLocale

  • I have an application running on an embedded device without proper locale support. That is, the settings are fixed, and cannot be changed easily. Only a default locale exists.

    I would like to enable the user to change certain locale settings easily for my application.

    Is there a way to e.g. set the decimal separator that is to be used when calling QLocale::toString?

  • AFAIK: no, there is not. In such cases, you could considder not using QLocale at all, or only to get some default values that you allow the user to change.

  • For the Date and Time format, I have methods where I can specify a custom format.

    When converting a float or double to string, I do not have such an option. Does that mean I have to write my own conversion function that uses "my" decimal separator?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.