Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 45
Registered: ‎07-29-2008
My Device: Z10 Red, 8900, PlayBook
My Carrier: E-Plus

How is QLocale::MeasurementSystem set?

Hi,

 

how is the QLocale::MeasurementSystem working? To me it seems that the value depends only the current language and not on the current setting of "Measurement System" in System Settings - Language and Input.

 

The Distance Measurement can be switch between Feet and Yard. Can I access this setting via QLocale too?

Klaus Nahr
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How is QLocale::MeasurementSystem set?

You can use https://developer.blackberry.com/cascades/reference/bb__system__localehandler.html to get to that measurement system setting.

 

I'm not aware of a way to retrieve the Feet/Yards switch yet, but I haven't looked for it at all either.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 45
Registered: ‎07-29-2008
My Device: Z10 Red, 8900, PlayBook
My Carrier: E-Plus

Re: How is QLocale::MeasurementSystem set?

As far as I tested, changing the Region has no effect on QLocale::MeasurementSystem, only changing the language.

 

For example: If the language is German and the region United States, the QLocale::MeasurementSystem is still Metric. When changing the language to English, the QLocale::MeasurementSystem switches to Imperial.

 

For language English and region India (HIndi) the QLocale::MeasurementSystem is Imperial, which is wrong, as they are using Metric. At least in Language and Input Metric is shown.

 

Klaus Nahr
New Contributor
Posts: 6
Registered: ‎12-14-2012
My Device: Z10 Limited Edition
My Carrier: Claro

How retrieve current MeasurementSystem ?

Any news about this problem?

 

I think this system settings can be read with "System UI" but do not understand how: http://developer.blackberry.com/cascades/reference/user_interface_system_ui.html

 

Any idea?