diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2010-06-09 21:00:20 (GMT) |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2010-06-09 22:08:22 (GMT) |
commit | 424735f91dbf5847640aca4011a309dbef7b1e31 (patch) | |
tree | e3ac8a906e2366df50ca6f1c48da2ee177e2336e /src | |
parent | 726607baf707318de6f685573553d22df4966f61 (diff) | |
download | Qt-424735f91dbf5847640aca4011a309dbef7b1e31.zip Qt-424735f91dbf5847640aca4011a309dbef7b1e31.tar.gz Qt-424735f91dbf5847640aca4011a309dbef7b1e31.tar.bz2 |
Add a isWrittenRightToLeft() method to QLocale.
This helps us keeping the code in the key mappers
that detect keyboard changes simple and is useful
for other cases as well.
Task-number: Part of QT-3292
Reviewed-by: Simon Hausmann
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 19 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index c000dc8..8f50f2e 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -3478,6 +3478,25 @@ QLocale::MeasurementSystem QLocale::measurementSystem() const } /*! + \since 4.7 + + Returns true if the language is written right to left. +*/ +bool QLocale::isWrittenRightToLeft() const +{ + Language lang = language(); + if (lang == QLocale::Arabic || + lang == QLocale::Hebrew || + lang == QLocale::Persian || + lang == QLocale::Urdu || + lang == QLocale::Syriac) + return true; + + return false; +} + + +/*! \since 4.5 Returns the localized name of the "AM" suffix for times specified using diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index f2fd892..f8b5c55 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -666,6 +666,8 @@ public: MeasurementSystem measurementSystem() const; + bool isWrittenRightToLeft() const; + inline bool operator==(const QLocale &other) const; inline bool operator!=(const QLocale &other) const; |