PDA

View Full Version : QPainter::drawText, draw big text



franco.amato
18th March 2010, 02:11
Hi I would draw text over my QWidget.
So I though to use
QPainter::drawText( QPoint(x,y), "hh:mm:ss" );

The problem is that I would draw big text and such routine doesn't provide such functionality.
I also would choose the color of the text.

How can I do?

Best Regards

aamer4yu
18th March 2010, 04:19
How about using QPainter::setFont before the drawText :confused:

nish
18th March 2010, 04:47
can also use transformation functions like QPainter::scale().

toutarrive
18th March 2010, 08:32
In your paintEvent(QPaintEvent* event) fct, you could use:


QFont font=painter.font() ;
font.setPointSize ( 18 );
//font.setWeight(QFont::DemiBold);
painter.setFont(font);
painter.drawText(....);