QTextEdit print rightToLeft arabic text
-
i have problem with QtextEdit::drawContents() whene i print right to left arabic char with other char like "-" or ":" the output is reversed in other word whene i try printing :ببببب - the result is -ببببب :
-
Hi,
Did you set the layout direction of your application ?
-
yes i try it but no thing change
i think that the problem is in the QPaintDevice because when i use QTextEdit::drawContents() with- QPainter (QPixmap) the output result is the same of QTextEdit view
but when i use QPainter(QPrinter) the output result is reversed
- QPainter (QPixmap) the output result is the same of QTextEdit view
-
Can you share the exact code where the problem manifests itself ?
-
http://s32.postimg.org/ng20k9zt1/Untitled_1.jpg look at this image
the function that draw in pixmap and show this pixmap in qlabel is
void drawPixMapFromTextEdit()
{
QPixmap* pm=new QPixmap(400,400);
QPainter p(pm);
textEdit->drawContents(&p,textEdit->rect());
p.end();}
the function that draw in printer is
void print()
{
QPrinter* pr=new QPrinter();
QPainter p(pr);
textEdit->drawContents(&p,textEdit->rect());
p.end();}
-
Ok, can you write a minimal compilable example that shows that behavior ?
-
when i compile my project with Desktop_Qt_5_5_1_MinGW_32bit there is no difference between QTextEdit view and printPerview but when i compile the project with Desktop_Qt_5_3_MSVC2012_OpenGL_32bit the printPerview is not the same thate QTextEdit !!!!!!!!!!!!!!!!!!!!!!!!!!!! ??? ??????
-
No need for so much exclamation or question marks. That just means that it's something that has been fixed between these two Qt versions.