PyQt, designer, and directional flow

David Boddie david at boddie.org.uk
Wed Dec 6 12:44:24 EST 2006


borntonetwork wrote:
> I am creating a simple form using designer (qt4) on Ubuntu. I use pyuic
> to create a python script from the form. I run the script and the form
> shows up fine. The idiosyncrasy occurs when I try to type text into a
> QTextEntry widget. The text is right-aligned, not left-aligned as I had
> set it up in the property editor in designer.
>
> This behavior is not limited to alignment in text fields. If I insert a
> QTableWidget and add items to it, the items appear from right to left,
> not left to right. For example, if I create a 4-column table and use
> setItem() to insert the numbers 1, 2, 3, and 4 into columns 0, 1, 2, 3
> respectively, I get this:
>
> 4 3 2 1
>
> The same thing goes with the headers. I create a QStringList ("1", "2",
> "3", "4") and add it using setHorizontalHeaderLabels() then the headers
> show up as 4 3 2 1.

This sounds like something to do with right-to-left layouts for
internationalisation rather than just "normal" right-aligned text and
layouts.

> This is my first qt app using python instead of C++, so I may be doing
> something wrong.

Not necessarily, though we should probably run through some checks. :-)

 * Do Qt applications written in C++ work fine on your system?
 * Is your system configured to use a right-to-left language, such as
   Arabic or Hebrew?
 * Have you tried previewing the form in Qt Designer and entering text,
   just to see if it behaves the same way there?

> I am grateful for any ideas someone might have.

Well, it sounds like a strange bug or configuration issue, but we can
probably figure out what's happening.

David




More information about the Python-list mailing list