Please provide minimum compilable example reproducing the problem, so we can see your actual code and check if there is something wrong or not.
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
Oh yeah, sorry, i should have posted it. just very simple example like here, I dont really think its the problem of my code, i used the same code in qt4.8.3, it works fine...
//just reinplement virtual function paintEvent and use QPainter instance to paint it
void MainWindow:aintEvent(QPaintEvent *)
{
QPainter painter;
painter.begin(this);
QRect rect1 = QRect(20, 20, 760, 420);
QRect rect2 = QRect(50,50,700,400);
QPen pen=QPen(Qt::red);
painter.setPen(pen);
QFont font;
font.setFamily("Droid Arabic Naskh");
font.setItalic(false);
font.setPixelSize(47);
painter.setFont(font);
QTextOption textOption;
textOption.setTextDirection(Qt::LeftToRight);
painter.drawText(rect1,QString::fromWCharArray(L"W elcome to the world of العالم ÙÙŠ navigatio"),textOption);
painter.end();
}
Thank god, finally i found how it happens....qt5.3.0 uses new unicode 6.3 while qt4.8.3 uses Unicode6.2... they have different ways to itemizer strings...like arabic text, in qt4.8.3,,e.g "العالم ÙÙŠ" it will be itemizered into 3 items, second item is space button...while in qt5.3.0, it will just itemizer into 1 items...so when it counts width to draw text, it gets full width while just draw part of arabic string.......confused?! sorry im not native english speaker.....ok here is the place and they way to fix it... in file "qtextlayout.cpp" , line 2025,,, x position shouldnt be positioned by si.width as si is the item of all arabic text with space..... so should be " x += gf.width; " just hope you guys can see it and wont spend too much time on this stupid bugs by Qt....cheers, and thank you all
Yeah, I did, you could visit QTBUG-40617 and they have confirmed it thank you so much btw!
Last edited by anda_skoa; 15th August 2014 at 09:25. Reason: make link clickable
Bookmarks