summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale.h
Commit message (Collapse)AuthorAgeFilesLines
* Re-generate QLocale data from CLDR v29Konstantin Ritt2016-04-081-5/+49
| | | | | | | | | | | * A bunch of fixes and additions to the locale data * Add new scripts from Unicode 8.0 and 9.0 * Map some potentially useful languages and territories [ChangeLog][QtCore] QLocale data updated to CLDR v29 Change-Id: I759ccb27fe19be2722be913c5c2e6aa5f36e5c14 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add ability to specify precision of float/double currency stringsDan Cape2016-01-131-3/+11
| | | | | | | | | | | | | | | Added a new overload function that allows the developer to specify the desired precision. Until 6.0, it will require the symbol and precision to be passed to it. Once Qt is at version 6.0, it will replace the overload function that requires a value and optionally a symbol. [ChangeLog][QtCore][QLocale] Added an overload for toCurrencyString() that allows the decimal precision to be specified. Change-Id: I1fb7dde3583f46de2ed20ec2a7abaeca23a903ef Task-number: QTBUG-46595 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark QLocale as sharedMarc Mutz2016-01-121-2/+6
| | | | | | | | It was already movable, so it's BC. Only needed to add nothrow member-swap and nothrow move assignment. Change-Id: Iefedb877078da8ee075eb67185eef221143ddec1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add flags to omit/reject padding in scientific notation exponentsUlf Hermann2015-11-231-1/+4
| | | | | | | | | | | | | | The EcmaScript format for printing doubles in exponent form differs from Qt's format only in this aspect. EcmaScript explicitly prohibits leading zeroes in exponents. It is thus worthwhile to add those flags in order to be able to generate and parse doubles in compliance with EcmaScript. [ChangeLog][QtCore][QLocale] Additional flags in QLocale::NumberOption allow generating and parsing doubles in EcmaScript compliant format. Change-Id: Ia7b82c2e67bb8b80bd890014ff5cd4563faf2a03 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Interpret precision == -128 as "shortest" double conversionUlf Hermann2015-11-231-0/+4
| | | | | | | | | | | | Also use this for converting doubles with QVariant. We generally want exact results there, rather than adding rounding errors whenever we convert. [ChangeLog][QtCore][QLocale] Added special value for double conversion precision to get shortest accurate representation. Change-Id: I905b8a103f39adf31d24b6ce2c8a283cf271b597 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QLocale: Add Q_ENUM for QLocale::ScriptThiago Macieira2015-10-281-0/+1
| | | | | Change-Id: I7e6338336dd6468ead24ffff141129d557330f00 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtCore: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-011-16/+16
| | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I0cc388ef9faf45cbcf425ad0dc77db3060c104a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add qHash(QLocale)Marc Mutz2015-06-301-0/+5
| | | | | | | | | | | QLocales can be compared for equality, so qHash should be overloaded, too. [ChangeLog][QtCore][QLocale] Added qHash(QLocale). Change-Id: Ia0fdf1207b842b9bb20b8f9ab0165016915debf4 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update CLDR to v27Konstantin Ritt2015-03-271-2/+50
| | | | | | | | | | | | | + A bunch of fixes in the locale data + New scripts from Unicode 7.0 + New locales - Some locales disappeared (aa_DJ, aa_ER, st_LS, ss_SZ, swc_CD, tn_BW) - Some locales lost their contents (i.e. en_Dsrt_US) [ChangeLog][QtCore] QLocale data updated to CLDR v.27 Change-Id: Iba8c7884f8087e577cbb25a8fc106dd7bd3ebb5d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Use Q_ENUM and Q_FLAG for types in QtCoreOlivier Goffart2015-02-041-3/+4
| | | | | | Change-Id: I33590a9c4c6d87c5bbba1d201e32c6bf1bd3e00b Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Update the internal CLDR tables up to v.24Konstantin Ritt2014-01-131-1/+4
| | | | | | | Change-Id: I9c0b110e36dd80c6a0b7275aa13bc548419aca9c Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
* Update QLocale locale database up to CLDR 23.1Konstantin Ritt2013-08-121-1/+2
| | | | | | | This only added Kosovo [XK] territory and few valid locales for it. Change-Id: Ia0b47041ed5cd1303b5bc233f2502a3725c74da9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update QLocale data to CLDRv23Konstantin Ritt2013-04-011-1/+3
| | | | | | | | Say hello to Interlingua and Mongolian once again. Change-Id: I735fbc5793f34620be1f6932a251224b9ded02e3 Reviewed-by: Denis Dzyubenko <denis@ddenis.info> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLocale: Add some more languages and scriptsKonstantin Ritt2013-03-051-3/+122
| | | | | Change-Id: Iab23128c1567974154cdcce7412b2e1468bb8462 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLocale: Added QStringRef overloads to toInt(), toUInt(), etc...Keith Gardner2013-02-181-0/+10
| | | | | | | | | | Added the following function overloads to QLocale: toShort, toUShort, toInt, toUInt, toLong, toULong, toLongLong, toULongLong, toFloat, and toDouble. Change-Id: I8cd90ca08b88338b08a73a72492f4c91c4f46ea4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a Q_ENUMS for MeasurementSystemmfekari2012-12-171-0/+1
| | | | | | Change-Id: Ib60de407f7ec8df907884ad2cf2fbf8e7b2c02f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* [SIC] QLocale: Update some language names with their modern valuesKonstantin Ritt2012-11-241-9/+11
| | | | | | | | Some of them were incorrectly spelled (for a while) Change-Id: I871968e3bbdd2172f4c4dfb6e74729c05e7e8e01 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update Qlocale data up to CLDR 22.1Konstantin Ritt2012-11-211-4/+14
| | | | | Change-Id: Ie6ddfec14cb052e0b89230dc93290ff79488fb25 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update Qlocale data up to CLDR 2.0.1Konstantin Ritt2012-11-211-1/+19
| | | | | Change-Id: I4279fac57436d7009a6d61dab5936b72fd39fc14 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [SIC/BIC] QLocale: update enums up to CLRD 1.9.1Konstantin Ritt2012-11-211-38/+81
| | | | | | | | | | This patch adds some missing codes (two-letter ones only), removes an outdated ones, and updates some names. The legacy language codes are handled in QLocalePrivate::codeToLanguage() (fortunately, there are only 4 of such codes). Change-Id: Iff50aecd1c762b6399cd151aebb955f341d366c6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a bunch of missed scriptsKonstantin Ritt2012-11-151-1/+26
| | | | | Change-Id: I078bf95cb50c7ef634f9f3133ab9f9d25439e4ef Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add missing Bodo language introduced in CLDR 1.9.1Konstantin Ritt2012-11-151-1/+2
| | | | | Change-Id: I4feb6ba781299d65ff3bf2717f08a0ac7eae7928 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Refactor the ICU code for QLocaleLars Knoll2012-06-101-0/+1
| | | | | | | | | | | | | | | | | Clean up the ICU code and make it thread-safe. Add a QIcuData structure to QLocalePrivate, that contains ICU specific data. Link against ICU directly, greatly simplifying the code. Also fix a bug in the locale specific case conversion code that would cause it to fail and fall back to the QString code if the output string was larger than the input. Change-Id: Ie67e5ea14fa204ebc5887d7aaeb1a4f3ecaf8697 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLocale: Clean up QLocalePrivate implementationJohn Layt2012-04-241-15/+6
| | | | | | | | | | | | | | In Qt4 QLocalePrivate is a struct returned by a d() method. This will be unsuitable for the planned change to use ICU and may cause BIC issues. This change makes QLocalePrivate a class and creates a new struct QLocaleData to hold the data index. Further clean-ups are possible but are left for later. Change-Id: Ie316a07790f74674a3b520b735dff72695cc4060 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QLocale::toULongLong return the proper type: qulonglongThiago Macieira2012-04-051-1/+1
| | | | | | | | Task-number: QTBUG-25143 Change-Id: Ia8fd588c25d11fe31acd57fd34a90d51dace248c Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Fix measurement system for the UKLars Knoll2012-03-261-1/+6
| | | | | | | | THe UK still uses the Imperial system at least for distances and many other things. Change-Id: I99379de35620114328ad6a7fc9b226a46692bedd Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Restore some source compatibilityLars Knoll2012-03-121-0/+1
| | | | | | | | | | | Add an implicit #include back in to avoid needless SC and compilation breaks. Add some deprecated method for codecForTr, until all other modules are ported to mot use it anymore. Change-Id: I5334b47a0c32819b9eb6b7203cc98ce4e6073a64 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Make qlocale.h not depend on qvariant.h.Stephen Kelly2012-02-291-1/+0
| | | | | | | As a consequence, we have to add more explicit includes. Change-Id: Ib3137031f0554b846c7bbd08f1f7df10dfeb8e61 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* SIC: QLocale: Make QSystemLocale a private classJohn Layt2012-02-051-69/+0
| | | | | | | | | | As discussed on list and approved by Lars and Thiago. Make QSystemLocale private to give us time and space to change it to a better implementation. Change-Id: Ifd806972f3996c43a876f544f78c6557ad71cd75 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* SIC: QLocale: Remove base argument from conversion to number apiJohn Layt2012-02-051-6/+6
| | | | | | | | | | | As discussed on list and approved by Lars and Thiago. Remove the option to use QLocale to convert strings to non-decimal numbers as they are not localised and the api is available in QString. Change-Id: Ib810505ba86fb08ad23571b39f1520e86fde6787 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Implement QDebug stream operators for builtin classesJędrzej Nowacki2012-01-101-0/+4
| | | | | | | | | | | QDebug stream operator was added for: QPixmap, QImage, QUuid, QBitArray, QLocale, QRegExp, QCursor, QPalette, QTextFormat, QTextLength, QIcon and QSizePolicy Change-Id: Ibcf5c9b599ba322d53cb106d8e5e157427ebe757 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Deinlined QLocale::operator==Denis Dzyubenko2012-01-041-6/+2
| | | | | | | | | Some time ago this was a blocker that didn't allow to refactor QLocale implementation due without making binary incompatible changes. Deinlining those functions for Qt5, it shouldn't be performance critical code path. Change-Id: I6cb19e32188a2df223d04be0c613a6176ad8d118 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Revert "Use standard spelling for two languages"Lars Knoll2011-11-041-2/+2
| | | | | | | | | | | This reverts commit 9358f7eaa4b773bdbfa45b08ab92a89096954881. The change is source incompatible and hasn't been agreed upon. Revert it even though it's correct in principle. It's simple to keep the old enums around for compatibility. Change-Id: I8d9d33868e44d0299a3f081833b06cedf0ed4345 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use standard spelling for two languagesJiang Jiang2011-11-041-2/+2
| | | | | | | | Singhalese -> Sinhalese Divehi -> Dhivehi Change-Id: I3faa7163202a4a9be14e3cf857da60aa4dd3196f Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Add QLocale::toUpper/LowerLars Knoll2011-08-311-0/+3
| | | | | | | | | | | | | | | | | The toUpper/Lower() methods in QString should not be locale dependent, as this can lead to rather hard to find bugs in at least a turkish locale. Rather have explicit, locale dependend case conversions available in QLocale. Reviewed-by: Denis Dzyubenko (cherry picked from commit da0e1e101bb4c44c25b6523357fa81ad1b2d6539) Change-Id: I1cc3f341bef17ad573a736dc94c9c5d514ace54e Reviewed-on: http://codereview.qt.nokia.com/3259 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+818
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12