I am writing a program that displays several QWidgets on the screen, within one parent QWidget. Then I have a QLabel that I draw with the drawText() method from QPainter. There are als Buttons to move around this Label on the screen (up, down, left, right).
Like so:

Qt Code:
  1. void MyClass::paintEvent(QPaintEvent*)
  2. {
  3. QPainter painter(this);
  4. painter.setBrush(Qt::red);
  5. QPen myPen;
  6. myPen.setWidth(1);
  7. myPen.setColor(foreground);
  8. painter.setPen(myPen);
  9. painter.drawText(xpos, ypos, textDisplay->text());
  10. }
To copy to clipboard, switch view to plain text mode 



Now, the QWidgets are always shown in the foreground, and the QLabel is shown in the background, behind the QWidgets. How can I change this order? I want the QLabel to be in the foreground.
Common sense tells you that whichever Object gets to be painted last should be in the foreground, since it is drawn "on top" of the other ones. How does one achieve this?