QLocale is a class from the Qt Toolkit which converts between numbers and their string representations in various languages.
Questions tagged [qlocale]
21 questions
0
votes
1 answer
How i could convert Persian numbers to English numbers using QLocale?
I want to convert Persian numbers to English numbers using QLocale, i wrote this code but it fail:
int main(void)
{
QLocale english_number(QLocale::Language::English, QLocale::Country::UnitedStates);
QTime time;
time =…

Ghasem Ramezani
- 2,683
- 1
- 13
- 32
0
votes
2 answers
QLocale Get real language name
I have a language code like fr_fr, fr_be.
I would like to get French and Belgium using QLocale, but I can't find how to do it.
I did:
QLocale locale("fr_fr"); // or fr_be
QString l = locale.languageToString(locale.language()); //returns French in…

SteveTJS
- 635
- 17
- 32
0
votes
0 answers
How to set specific char as group separator in QLocale?
Each locale in Qt have different symbols used as group separator ( ',', '.' or 0xa0 for example).
Is it possible somehow for Qt application to use all settings for current locale and override char used as group separator? So it will be automatically…

Ation
- 731
- 7
- 16
0
votes
1 answer
Qml Locale has same format for ShortFormat and NarrowFormat
I'm trying to display the date (and time) using the toLocaleDateString / toLocateTimeString methods implemented on the Date type in Qml (doc here). It works, except for the ShortFormat which is the same as the NarrowFormat.
Here's an example:
import…

lesurp
- 343
- 4
- 19
0
votes
1 answer
QLocale setDefault only works at 2nd time called
I am trying to change the default language of a QLocale variable in my code and then use the different separators of each language. I do not want to change it for the whole system I just want to have a chance to print numbers with different group-…

Earinor
- 35
- 1
- 6
-1
votes
1 answer
Is there any way for QLocale::formattedDataSize function to return the translation quantified units?
QLocale::formattedDataSize always return English quantified units.

deMax
- 86
- 7