I tried to draw a text but the text didnot appear on screen. Can anyone help me out?
Thanks in advance.

Happylucy



void MyMainWindow:aintEvent( QPaintEvent * )
{
QPainter p;

//
p.begin( this );
QFont f( "courier", 14, QFont::Bold );
QColor background = backgroundColor();
p.setPen( Qt::blue );
p.setFont( f );
p.fillRect(0, 0, width(), height(), Qt::cyan);
p.flush();

QFontMetrics fm = p.fontMetrics();
nMaxTextWidth = fm.width("Hello");
nMaxTextHeight = fm.height();


p.drawText( 10, 10, "Hello");
p.flush();

//
fflush(stdout);
p.end();
// exit
exit(EXIT_SUCCESS);
}