PDA

View Full Version : How to improve the font style?



aaron
19th January 2010, 01:37
Hi all,
Good morning!
I meet a question about font style. When I use QPainter::drawText(...) method to draw a text on QGraphicsScene, but the text is not
clearly,like attachment. And how to fix it? Thanks!
By the way, The font's family is "Times", my code is like below:
QFont font = QFont("Times");
font.setPixelSize(4);
font.setFixedPitch(true);
QPen pe = painter.pen();
pe.setFont(font);
painter.setPen(pe);
painter.drawText(pos, index);

numbat
19th January 2010, 06:58
It looks like you are drawing the text multiple times at a slightly different postion. Use qDebug to see what pos is doing. Or paste some more code, preferably the minimum amount to reproduce the problem.