[Qt-interest] QTextEdit input from right to left (SOLVED)

Diego Iastrubni diegoiast at gmail.com
Tue Mar 23 08:43:32 CET 2010


You are definitely doing something wrong if you had to resort to this ugly
hack.

On Tue, Mar 23, 2010 at 3:57 AM, Yong Zhang <yzhang.qt at gmail.com> wrote:

> Hi All,
>
> The problem is solved by adding the following line to the code:
>
> textEdit->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
>
> Basically I have to move the cursor to the end of the document every time
> the QTextEdit is changed.
>
> Thank you very much,
>
> Best,
>
> Yong
>
>
>
> On 3/22/2010 6:24 PM, Yong Zhang wrote:
>
>> Hi Diego,
>>
>> Below are some sample codes:
>>
>> In one function, the textEdit widget is connected to a function called
>> myTextChanged():
>>
>> connect(textEdit, SIGNAL(textChanged()), this, SLOT(myTextChanged()));
>>
>> Inside the myTextChanged() function, I simply called the following to
>> get the new text:
>>
>> mytext=textEdit->toPlainText();
>>
>> I want myTextChanged() function to be called when any change is occurred
>> to the textEdit widget, such as a new letter is entered by the user or a
>> letter is removed from the current content.
>>
>> Thanks,
>>
>> Yong
>>
>>
>>
>> On 3/22/2010 1:27 PM, Diego Iastrubni wrote:
>>
>>> Are you sure you did not:
>>> QWidget->setLayoutDirection(Qt::rightToLeft)?
>>>
>>> Please provide a working code that reproduces the problem.
>>>
>>> On Mon, Mar 22, 2010 at 8:51 PM, Yong Zhang <yzhang.qt at gmail.com
>>> <mailto:yzhang.qt at gmail.com>> wrote:
>>>
>>> Hi All,
>>>
>>> I am using Qt 4.6 on Windows XP Professional.
>>>
>>> In my application, I use a QTextEdit for user to input some text
>>> information. However, it is strange that when the user input the text
>>> inside the QTextEdit, the text is entered from right to left, instead of
>>> from left to right, that is, the new letter appears at the very left but
>>> not the right location of the previous letters. I checked the QTextEdit
>>> property and did not find anything related to this. I am wondering if
>>> anyone has this similar problem and how I could solve it.
>>>
>>> Thank you very much,
>>>
>>> Yong
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100323/73690f1b/attachment.html 


More information about the Qt-interest-old mailing list