platform :QT4.6,QT4.7 linux

Hi, All,

I got a very strange problem about paintEvent.
Here is my code

Qt Code:
  1. ....
  2. status = true; //set status to true by default
  3. ....
  4.  
  5. void MainWindow::paintEvent(QPaintEvent * event )
  6. {
  7. qDebug()<<"paintEvent";
  8.  
  9. QMainWindow::paintEvent(event);
  10. QPainter p(this);
  11. if(status)
  12. p.drawText(110,110,"hello");
  13. else
  14. p.drawText(110,110,"world");
  15. }
  16.  
  17. void MainWindow::on_pushButton_clicked()
  18. {
  19. if(!status)
  20. status = true;
  21. else
  22. status = false;
  23. }
To copy to clipboard, switch view to plain text mode 

Here is my steps:
1. start app , on the window it shows "hello"
2. click button, status changed to false
3. move the window to the edge of the screen ,until it become invisible.
4. move the window back to the center of the screen
5. from debug info,I can see that paintEvent has been called,
but what puzzled me is that in the window, it still shows "hello" !!!
6. minimize the window and the raise it again, the window also still shows "hello"
7. resize the window ,now it shows "world"

any ideas about it ?
Thanks in advance for your help.

Best regards,
hb