[Qt-interest] RTL text input problem

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Fri Feb 12 10:21:17 CET 2010


rm rm wrote on Friday, February 12, 2010 8:50 AM:

> ...when I type a word in the widget ( arabic) all the
> things are right but when I press the Space key the cursor goes at
> the begining of the line. and then after pressing another key the
> cursor jumps to the end of line and all the things are right untile
> another space character .

I can reproduce this behaviour with the example %QTDIR%\examples\mainwindows\mdi\ (http://qt.nokia.com/doc/4.6/mainwindows-mdi.html), see attached screenshot. In the "File" menu the layout direction can be set. 

The spaces are inserted at the proper places (between the words), but after each time the "space" (key) is hit, the cursor jumps to the very left (and changes its look: the very small "arrow" thing points to the left instead of to the right).

Pressing "Space" multiple times initially inserts the whitespace also to the left, but as soon as the first "non-space" character is entered the space and the non-space character are properly positioned again on the right.

But maybe I am also misunderstanding the concept of the layout direction "Right to left": When I enter text such as "This text is right to left", should it not be displayed as:

  "tfel ot thgir si txet sihT"

(That is, in "reverse" order, or as "read from right to left")
?

It appears to me that I still write "left to right", with the only difference that the text is right-aligned. Or does one have to set some other settings (besides the http://qt.nokia.com/doc/4.6/qt.html#LayoutDirection-enum) in the Qt API as to support properly "right-to-left" languages?


As seen on Windows XP SP3, Qt 4.6.1, compiled from source (VS 2005).


Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
-------------- next part --------------
A non-text attachment was scrubbed...
Name: layout_direction_and_space.png
Type: image/png
Size: 5535 bytes
Desc: layout_direction_and_space.png
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100212/b2cd0417/attachment.png 


More information about the Qt-interest-old mailing list