[Qt-creator] Locale for plugin

Thomas Meyer public at meyer-thomas.com
Tue May 21 15:08:38 CEST 2013


Hi,
there is a need for 'setDefault()' I think, but I can't find it.
True?

I have done this for now:
...
         QStringlocale=Core::ICore::userInterfaceLanguage();

     if  (locale.isEmpty())

     {

         locale  =  QLatin1String("en_US");

     }

     QLocale  l(locale);

     setLocale(l);
...



Thomas


Am 21.05.2013 13:07, schrieb Ziller Eike:
> On 18.05.2013, at 15:24, Thomas Meyer <public at meyer-thomas.com> wrote:
>
>> Hi,
>> how can I get the locale for a plugin?
>> I need the decimal / grouping characters and date / time formats
>> (for MS Windows) in the chosen language.
>> I have tried something with 'Core::ICore::userInterfaceLanguage()' and
>> I found that the "qtc_locale" property is never set by
>> "English" or "C", because it is built-in. So, the
>> "qtc_locale" is empty.
> Probably not ideal, but if qtc_locale is empty, just use QLocale() instead of QLocal(userInterfaceLanguage)
>
> Br, Eike
>
>> Qt Creator version:
>>
>> Qt Creator 2.7.0
>> Based on Qt 5.0.2 (32 bit)
>>
>> Built on Apr 9 2013 at 09:32:03
>>
>>  From revision b6257ef735
>>
>> Thanks,
>>      Thomas
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qt-creator

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20130521/2af5cb28/attachment.html>


More information about the Qt-creator mailing list