Hi,
I’m using QPAinter drawText to paint a text using a font.
The problem is thata antialiasing is not working so the text is ugly to see.
Here is the code:
QPainter customPainter(this);
QPen pen( QColor(0, 0, 0));
pen.setWidth( 0 );
customPainter.setPen( pen );
customPainter.setBackground(QBrush(QColor(0, 0, 0)));
customPainter.setBrush(QBrush(QColor(0, 0, 0)));
customPainter.setRenderHint(QPainter::TextAntialiasing,true);
QFontDatabase database;
QFont font = database.font("Tw Cen MT", "Normal",40);
customPainter.setFont(font);
customPainter.drawText(0,0,300,50,Qt::AlignLeft,"Galileo");
Am I doing something wrong?
↧