[Qt-interest] Issues with layout direction in an Arabic locale

André Fillipe andref at syst.com.br
Fri Jul 30 20:59:18 CEST 2010


Hello!

While localizing an app to the Arabic (Saudi Arabia) locale, I
noticed that the layout direction of the application is not inferred
from the system locale.

For example, If I change the user settings to an Arabic locale and
run a simple test program, QApplication::layoutDirection() is always
left-to-right.

The documentation says the default value of this property "depends on
the application's language," a concept that doesn't really exist in
Qt: there is the system locale. Am I forgetting something important
here? On Linux, I just set LANG to "ar_SA.UTF-8" and on Mac OS X I
drag "Arabic" to the top of the preferred languages list.

Another strange behavior is that manually calling
QApplication::setLayoutDirection  on Linux does not influence the
layout direction of widgets created and displayed afterward. I have
to set it on each widget that is displayed. On Mac OS X it works, but
only if I do it after installing the locale-specific QTranslator.

The last gripe I have is a widget not inheriting its parent's layout
direction when it's added after the parent's value is set. Why is
that?

Has anyone else had trouble with layout direction and the Arabic
locale? Any help is appreciated!

Thank you!

-- 
André Fillipe




More information about the Qt-interest-old mailing list