[Qt-qml] qml locale aware string comparison

378 views
Skip to first unread message

denis.d...@nokia.com

unread,
Dec 22, 2011, 8:52:31 AM12/22/11
to qt-...@qt.nokia.com
Hi guys,

Are there are any plans to implement locale aware string comparison api for QML?

What about any other locale aware properties, including but not limiting to date/time formatting?

Denis

_______________________________________________
Qt-qml mailing list
Qt-...@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Alan Alpert

unread,
Dec 22, 2011, 8:18:04 PM12/22/11
to qt-...@qt.nokia.com
On Thu, 22 Dec 2011 23:52:31 ext denis.d...@nokia.com wrote:
> Hi guys,
>
> Are there are any plans to implement locale aware string comparison api for
> QML?
>
> What about any other locale aware properties, including but not limiting to
> date/time formatting?

It's there already: http://doc.qt.nokia.com/qt5-snapshot/qml-qtquick2-
locale.html

I don't think it does locale aware string comparison, but it does do locale
aware strings (like date/time formatting). Perhaps you can just compare those.

--
Alan Alpert
Senior Engineer
Nokia, Qt Development Frameworks

denis.d...@nokia.com

unread,
Dec 23, 2011, 12:24:26 PM12/23/11
to alan....@nokia.com, qt-...@qt.nokia.com
Hi,

On 23 Dec 2011, at 02:18, ext Alan Alpert wrote:

> On Thu, 22 Dec 2011 23:52:31 ext denis.d...@nokia.com wrote:
>> Hi guys,
>>
>> Are there are any plans to implement locale aware string comparison api for
>> QML?
>>
>> What about any other locale aware properties, including but not limiting to
>> date/time formatting?
>
> It's there already: http://doc.qt.nokia.com/qt5-snapshot/qml-qtquick2-
> locale.html
>
> I don't think it does locale aware string comparison, but it does do locale
> aware strings (like date/time formatting). Perhaps you can just compare those.

oh great. I am mostly interested in locale aware string comparison though - what QString::localeAwareCompare() does - e.g. determining sort order of words like "china", "danmark" - they will be sorted differently in english and czech locales.

Denis

denis.d...@nokia.com

unread,
Dec 23, 2011, 12:32:37 PM12/23/11
to alan....@nokia.com, qt-...@qt.nokia.com

On 23 Dec 2011, at 02:18, ext Alan Alpert wrote:

> On Thu, 22 Dec 2011 23:52:31 ext denis.d...@nokia.com wrote:
>> Hi guys,
>>
>> Are there are any plans to implement locale aware string comparison api for
>> QML?
>>
>> What about any other locale aware properties, including but not limiting to
>> date/time formatting?
>
> It's there already: http://doc.qt.nokia.com/qt5-snapshot/qml-qtquick2-
> locale.html

btw, who was implementing that api? It seems to be missing toCurrentString - which uses the locale's currency symbol position and spacing.

Denis

martin...@nokia.com

unread,
Jan 2, 2012, 9:55:23 PM1/2/12
to denis.d...@nokia.com, alan....@nokia.com, qt-...@qt.nokia.com
I implemented the locale API. There is a toLocaleCurrencyString() extension to Number, which has missed out on documentation. I'll add that soon.

Martin.

martin...@nokia.com

unread,
Jan 2, 2012, 10:01:13 PM1/2/12
to denis.d...@nokia.com, alan....@nokia.com, qt-...@qt.nokia.com

denis.d...@nokia.com

unread,
Jan 3, 2012, 7:59:05 AM1/3/12
to martin...@nokia.com, qt-...@qt.nokia.com

On Jan 3, 2012, at 4:01 AM, Jones Martin (Nokia-MP/Brisbane) wrote:

Great! I just didn't find it linked from Locale documentation. I pushed a tiny patch for you to review: http://codereview.qt-project.org/12024

Denis.

Reply all
Reply to author
Forward
0 new messages