Fix alignment of a QLineEdit?



  • Hi,

    we made a GUI (QT 4.5.0), with some QLineEdits that are right-aligned because they contain Hebrew text.

    But on a Hebrew Windows, doing CTRL+SHIFT makes the text inside the QLineEdit to be left-aligned; which should not be possible in our case.

    Below is is an example of a QLineEdit in our UI file. As you can see, the QLineEdit is read-only.

    Is there any property that can 'fixate' the alignment (= disable the CTRL + SHIFT)?
    Or a work-around like intercepting CTRL + SHIFT? Or ...?

    Thx, br,
    Stef

           <widget class="QLineEdit" name="txtIdentity_Name">
            <property name="geometry">
             <rect>
              <x>30</x>
              <y>30</y>
              <width>331</width>
              <height>20</height>
             </rect>
            </property>
            <property name="font">
             <font/>
            </property>
            <property name="layoutDirection">
             <enum>Qt::LeftToRight</enum>
            </property>
            <property name="text">
             <string/>
            </property>
            <property name="frame">
             <bool>false</bool>
            </property>
            <property name="alignment">
             <set>Qt::AlignBottom|Qt::AlignRight|Qt::AlignTrailing</set>
            </property>
            <property name="readOnly">
             <bool>true</bool>
            </property>
           </widget>


  • Does that lineEdit is having a input mask (something that restricts the input in lineedit to only say numbers)? I think there is a bug for right aligned line edits with input mask.



  • Hi!

    there's no input mask, AFAIK. And a search for' setinputmask' in the code didn't return any results either..

    I can put text and numbers in the field, and they are nicely right-aligned. It's just that nasty CTRL - SHIFT that causes a left-alignment..

    grts,
    Stef


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.