look at this code, it only draw ONE ellipse.
I want to draw TWO ellipses.
What is wrong here??

shape.cpp
Qt Code:
  1. void shape::paintEvent( QPaintEvent * )
  2. {
  3. QPainter painter( this );
  4.  
  5. QRectF rectangle1(10.0, 20.0, 80.0, 60.0);
  6. painter.drawEllipse(rectangle1);
  7.  
  8. QRectF rectangle2(100.0, 200.0, 80.0, 60.0);
  9. painter.drawEllipse(rectangle2);
  10.  
  11. }
  12.  
  13. void shape::drawMyCircle()
  14. {
  15.  
  16. QPainter painter( this );
  17. QRectF rectangle(150.0, 250.0, 80.0, 60.0);
  18. painter.drawEllipse(rectangle);
  19.  
  20. }
To copy to clipboard, switch view to plain text mode 

main.cpp
Qt Code:
  1. #include "shape.h"
  2. #include <QApplication>
  3.  
  4.  
  5. int main( int argc, char **argv )
  6. {
  7.  
  8. QApplication a ( argc, argv );
  9.  
  10. shape myShape;
  11. myShape.resize(640, 480);
  12. myShape.show();
  13. myShape.drawMyCircle ();
  14. myShape.show(); //<--- why dont refresh?
  15.  
  16. return a.exec ();
  17.  
  18. }
To copy to clipboard, switch view to plain text mode