I try to draw a line using the following code:

bool ok;
QPainter p;
ok=p.begin(this);
QColor qcred(Qt::red);
p.setPen(qcred);
p.drawLine(10, 80, 90, 20);
p.end();

ok has the value true.

However, I don't see a line drawn. How do I solve this?

Daan