I'd like to draw a simple line into a frame, but nothing is showing. What I'm doing wrong? Thanks

void myClass:buildInterface()
{
QFrame *myFrame;
........
QPainter *p;
p=new QPainter();
p->begin(myFrame);
p->drawLine( QPoint(0,0), QPoint(500,500) );
p->end();
}