Bug 173657 - text in KTextEdit is left-aligned in RTL languages
Summary: text in KTextEdit is left-aligned in RTL languages
Status: RESOLVED UPSTREAM
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeui (show other bugs)
Version: 4.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords: rtl
: 173237 176362 176594 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-27 09:11 UTC by Shlomi Fish
Modified: 2011-12-28 13:32 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shlomi Fish 2008-10-27 09:11:18 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Kopete's chat input box (the one you use to enter text for the conversation), is always left-aligned, even when the entire sentence is written in Hebrew (which requires right-alignment). The text is displayed fine in the chat window after it is entered.
Comment 1 George Kiagiadakis 2008-11-01 11:02:14 UTC
I think this is a QTextEdit bug. It also applies for kmail's composer and probably other apps too. Could somebody confirm that it is a QTextEdit bug? For testcase, open Qt designer, create a new widget and add a new QTextEdit in it, then preview the form and type some hebrew or some other rtl language.
Comment 2 Diego Iastrubni 2008-11-01 11:20:55 UTC
Unlike Qt3, Qt4 does not automaticlally decides the direction of the text editor. This should be addressed in KTextEdit and not kopete.

The display, the text sent, is still sending rl=1 if QString::isRightToLeft(), this is why even tough the local text is borked, the remote is fine.
Comment 3 George Kiagiadakis 2008-11-01 13:56:11 UTC
*** Bug 173237 has been marked as a duplicate of this bug. ***
Comment 4 George Kiagiadakis 2008-11-01 13:58:56 UTC
According to bug 173237, this also applies for KLineEdit.
Comment 5 Jaime Torres 2008-11-30 00:07:20 UTC
*** Bug 176362 has been marked as a duplicate of this bug. ***
Comment 6 George Kiagiadakis 2008-12-17 11:31:49 UTC
*** Bug 176594 has been marked as a duplicate of this bug. ***
Comment 7 Nadav Kavalerchik 2009-01-06 18:28:44 UTC
setting "rtl support" in qtconfig-qt4 (interface tab) solve this issue 
(i think)
Comment 8 Dror Levin 2009-02-27 16:14:48 UTC
I have that option selected in qtconfig and I have this problem as well.
Also, this problem happens in version 4.2.
Comment 9 Nadav Kavalerchik 2009-02-27 17:40:51 UTC
did you try pressing right CTRL + right SHIFT ?
it aligns the entire paragraph (textbox) to the right
left CTRL + left SHIFT does the opposite.

temporarily work-around
Comment 10 Dotan Cohen 2009-06-26 12:15:47 UTC
> This should be addressed in KTextEdit and not kopete.

Is this the bug for that, or does a new bug need to be filed?
Comment 11 Christoph Feck 2009-12-11 04:03:08 UTC
(In reply to comment #1)
> I think this is a QTextEdit bug. It also applies for kmail's composer and
> probably other apps too. Could somebody confirm that it is a QTextEdit bug? For
> testcase, open Qt designer, create a new widget and add a new QTextEdit in it,
> then preview the form and type some hebrew or some other rtl language.

Can someone confirm this bug is still present in Qt 4.6? I don't know how to "type hebrew", and if the bug needs to be filed to Nokia, I would need a description how it can be reproduced.
Comment 12 Nadav Kavalerchik 2009-12-11 09:43:05 UTC
still persist in qt 4.6 & kde 4.3.4 (debian)
Comment 13 Shlomi Fish 2009-12-11 10:31:57 UTC
(In reply to comment #11)
> (In reply to comment #1)
> > I think this is a QTextEdit bug. It also applies for kmail's composer and
> > probably other apps too. Could somebody confirm that it is a QTextEdit bug? For
> > testcase, open Qt designer, create a new widget and add a new QTextEdit in it,
> > then preview the form and type some hebrew or some other rtl language.
> 
> Can someone confirm this bug is still present in Qt 4.6? I don't know how to
> "type hebrew", and if the bug needs to be filed to Nokia, I would need a
> description how it can be reproduced.

It is, at least in the Kopete of KDE-4.4beta1. Hebrew text is aligned to the left by default. Pressing Ctrl+Shift indeed aligns it to the right.

Regards,

-- Shlomi Fish
Comment 14 Dotan Cohen 2009-12-11 11:00:26 UTC
@Christoph:
‏You can copy and paste this text if you need Hebrew:
כמה חול יכול לאכול ציפול חול ביום חול?‏

Note that text ends in an RLM character, to keep the punctuation at the end (left) in this LTR environment (bugzilla). You might loose that character by copying the text, but the current issue should still be reproducible.
Comment 15 Diego Iastrubni 2009-12-11 14:31:58 UTC
Christoph Feck,

In Qt3, all display widgets set the paragraph direction to RTL when the first strong char was RTL. Now, iq Qt4 the direction is derived only from QWidget::layoutDirection(). People are asking for the automatic text direction to be ported on the K* widgets.

This is still valid, and not a Qt4 bug - they changed behaviour in purpose.
Comment 16 Dotan Cohen 2009-12-11 21:04:08 UTC
> This is still valid, and not a Qt4 bug - they
> changed behaviour in purpose.

There may not be a programming error however this is unexpected behaviour with no obvious solution. Programming error or poor design decision, it is a bug.
Comment 17 Shlomi Fish 2010-05-25 21:13:24 UTC
I'd like to work on solving this problem (I am a programmer), but I need some guidance: why isn't the direction of the text preserved after pressing enter to submit the message? What causes it to become reset, and how can I preserve it?
Comment 18 Zayed Al-Saidi 2011-11-14 19:24:15 UTC
I think this bug has been fixed in Qt. Could you check with Qt 4.7.4?
Comment 19 Shlomi Fish 2011-11-25 11:04:42 UTC
Kopete now works fine (In reply to comment #18)
> I think this bug has been fixed in Qt. Could you check with Qt 4.7.4?

OK, Kopete is now working fine with regards to the direction of the text in the chat input box.
Comment 20 Dotan Cohen 2011-12-28 10:51:03 UTC
In KDE 4.7.3 (Kopete 1.1.3) on Kubuntu 11.10 I can confirm that Ctrl-Shift can be used to set directionality in Kopete's chat input box.
Comment 21 Dotan Cohen 2011-12-28 10:52:48 UTC
However, in Kate I cannot set the directionality manually. It seems that Kate decides directionality by the first character of the line, and that there is no manual override.
Comment 22 Christoph Feck 2011-12-28 13:32:32 UTC
Dotan, this bug is about QTextEdit (and derived classes). Kate does not use QTextEdit, so please report a new bug for Kate, with simple steps to reproduce.