From some messages I've read, I believe it's possible to paint directly onto a QMdiArea, but obviously I am not doing it right. This is not surprising since my C++ skills are very limited.
In Qt Creator I have added a QMdiArea called mdiArea_test inside a QWidget. I try to draw an ellipse and a rectangle + text within mdiArea_test with the following code, but it does not generate anything:

QBrush brush;
brush.setColor(Qt::green);
QPainter painter(mdiArea_test->viewport());
// do paint operations
painter.setBrush(brush);
painter.drawEllipse(20,20,10,10);
painter.setPen(Qt::black);
QRect rect = QRect(0, 0, 20, 20);
painter.drawText(rect, Qt::AlignCenter, "Data");
painter.drawRect(rect);
painter.end();

I would be grateful if somebody could show me my mistake(s).

Thanks
Gib