QLocale: Report RTL text direction for pa_Arab and uz_Arab

Change-Id: I97c785c9cbf550ef1ab330a4905ff7ae97ee6a30
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Konstantin Ritt 2012-12-10 12:34:29 +02:00 committed by The Qt Project
parent eb2688c4c4
commit 159713de3b

View File

@ -2240,16 +2240,23 @@ QLocale::MeasurementSystem QLocale::measurementSystem() const
*/
Qt::LayoutDirection QLocale::textDirection() const
{
Language lang = language();
if (lang == QLocale::Arabic ||
lang == QLocale::Hebrew ||
lang == QLocale::Persian ||
lang == QLocale::Pashto ||
lang == QLocale::Urdu ||
lang == QLocale::Syriac ||
lang == QLocale::Divehi)
switch (language()) {
case QLocale::Arabic:
case QLocale::Hebrew:
case QLocale::Persian:
case QLocale::Pashto:
case QLocale::Urdu:
case QLocale::Syriac:
case QLocale::Divehi:
return Qt::RightToLeft;
case QLocale::Punjabi:
case QLocale::Uzbek:
if (script() == QLocale::ArabicScript)
return Qt::RightToLeft;
// fall through
default:
break;
}
return Qt::LeftToRight;
}