[Interest] Qt 4.8 arabic rendering problem

Thiago Macieira thiago.macieira at intel.com
Mon Dec 29 13:55:11 CET 2014

On Monday 29 December 2014 12:50:16 Ender Erel wrote:
> Hi Everyone,
> I am trying to render some arabic text, mixed with latin characters, on a
> QLabel. When the text starts with arabic characters and latin characters
> are in the middle of the text, the text is aligned to the right. But when
> the text begins with a latin character, the text is aligned to the left,
> even though the rest of the text is in arabic.
> I've tried using QApplication::setLayout(Qt::RightToLeft) and translating
> "LTR" to "RTL", but neither solved the problem. The only way I found was to
> use QLabel:: setAlignment(Qt::AlignRight) manually, which I am trying to
> avoid.
> I'm sure there's something that I am missing, so I'd be glad if anyone could
> help.

Make the first character a Unicode character that forces the string to RTL. 
That's how Unicode requires it.
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Interest mailing list