Restore QTextEdit widget for RTL text in the Cell Editor by mgrojo · Pull Request #1929 · sqlitebrowser/sqlitebrowser

@mgrojo

This restores the Qt text widget that was replaced by a QScintilla one in
45c1e2a

QScintilla does not support right-to-left scripts like Arabic, so QTextEdit
is still needed for these languages. Since the QScintilla editor has other
advantages already explained, it is preserved for general text edition.

RTL texts are detected when data is loaded and the Qt editor is
automatically selected. This is done both when loading data from the cell
and when interactively typing RTL characters in the Cell Editor.

All these changes can be undone if a new QScintilla editor supports RTL
texts.

See comments in issue #1793

This restores the Qt text widget that was replaced by a QScintilla one in
45c1e2a

QScintilla does not support right-to-left scripts like Arabic, so QTextEdit
is still needed for these languages. Since the QScintilla editor has other
advantages already explained, it is preserved for general text edition.

RTL texts are detected when data is loaded and the Qt editor is
automatically selected. This is done both when loading data from the cell
and when interactively typing RTL characters in the Cell Editor.

All these changes can be undone if a new QScintilla editor supports RTL
texts.

See comments in issue #1793

@justinclift

Yeah, sounds like this will be the way to go, until QScintilla supports RTL languages. Hopefully some day. 😄

Thanks for putting the time in for this @mgrojo. It can be a bit disappointing when a good idea doesn't work out. 😦

@mgrojo

I make these pull request so users working with right-to-left languages can provide feedback before merging. @Johntaa can you compile from sources or would you need a build from this branch?

I'd like to know if the work flow displaying and entering RTL texts is correct.

@Johntaa

I make these pull request so users working with right-to-left languages can provide feedback before merging. @Johntaa can you compile from sources or would you need a build from this branch?

I'd like to know if the work flow displaying and entering RTL texts is correct.

Wow, Thank you for taking this step , it is greatly appreciated. I prefer a build from this branch.

@Z4us

Z4us commented

Jul 4, 2019

via email

Loading

1 similar comment

@Z4us

Z4us commented

Jul 4, 2019

via email

Loading

@mgrojo

Wow, Thank you for taking this step , it is greatly appreciated. I prefer a build from this branch.

And what operating system are you using, @Johntaa? In any case I think we'd need help from @justinclift.

@Johntaa

Wow, Thank you for taking this step , it is greatly appreciated. I prefer a build from this branch.

And what operating system are you using, @Johntaa? In any case I think we'd need help from @justinclift.

Win64

@justinclift

@Johntaa

@justinclift , Thank you .
@mgrojo : great work, but still there is a small problems, sometimes the text field starts with a Latin character, that causes the program to select TEXT option for the content type , which requires change it back to RTLText option which produce a non-ordered arabic text (Randomized Arabic words not in the right direction), the second problem is that the widget cannot wrap lines within its borders and will show the horizontal scroll bar in the bottom , in RtlText option.

@mgrojo

@mgrojo : great work, but still there is a small problems, sometimes the text field starts with a Latin character, that causes the program to select TEXT option for the content type , which requires change it back to RTLText option which produce a non-ordered arabic text (Randomized Arabic words not in the right direction),

Ok, I'll make a change in the RTL text detetion and I hope it will work better. The workaround for the current behaviour would be to change to the manual mode (button with the cog) and selecting RTL Text before writing the cell content.

the second problem is that the widget cannot wrap lines within its borders and will show the horizontal scroll bar in the bottom , in RtlText option.

This is configurable and it's the same for both widgets. There is button with a white page with text lines, which can be used to switch between scrolled lines or word wrapp.

Qt's isRightToLeft() returns true only for all left-to-right characters
in the string. That prevents the automatic switch to LTR Text mode, when
the text contains one or more left-to-right characters.

See #1793 and #1929

@mgrojo

@Johntaa, mixed Latin and Arabic texts should work now. Could you test and confirm? @justinclift, we would need another build of this branch.

@justinclift

@Johntaa

@mgrojo : tested using sample database with both Latin and Arabic characters , working great. I don't see any problem. Thanks.
@justinclift Thank you.

@mgrojo

Thanks, @Johntaa. Then I suppose this branch could be merged now, because the code is mostly recovered from previous versions with minor additions. I will wait till tomorrow, though, just in case someone would like to make a review.

@mgrojo mgrojo deleted the qt_ltr_text_editor branch

July 11, 2019 20:10

@justinclift

@mgrojo mgrojo restored the qt_ltr_text_editor branch

October 14, 2023 21:27

@mgrojo mgrojo deleted the qt_ltr_text_editor branch

October 14, 2023 21:48