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 -ببببب :

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

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();

}

Untitled-1.jpg