I'm in a good mood today, so I'll give you ready-made (compilable) solution, if this isn't enough, then you need to go back to the books (you should anyway, most of stuff guys above are saying is in the documentation)
Qt Code:
  1. // header
  2. #ifndef MAINWINDOW_H
  3. #define MAINWINDOW_H
  4.  
  5. #include <QtGui/QMainWindow>
  6.  
  7. class MainWindow : public QMainWindow
  8. {
  9. Q_OBJECT
  10.  
  11. public:
  12. MainWindow( QWidget* parent = 0 );
  13.  
  14. public slots:
  15. void redrawEllipse( void );
  16.  
  17. protected:
  18. void paintEvent( QPaintEvent* event );
  19.  
  20. private:
  21. int radius;
  22. };
  23.  
  24. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. // implementation
  2. #include "mainwindow.h"
  3.  
  4. #include <QPainter>
  5. #include <QTimer>
  6.  
  7. MainWindow::MainWindow( QWidget* p )
  8. :
  9. radius( 1 )
  10. {
  11. QTimer* t = new QTimer( this );
  12. connect( t, SIGNAL( timeout() ), this, SLOT( redrawEllipse() ) );
  13. t->start( 10 );
  14. }
  15.  
  16. void MainWindow::redrawEllipse( void )
  17. {
  18. radius += 2;
  19.  
  20. if( radius > qMin( this->width()/2, this->height()/2 ) )
  21. {
  22. radius = 1;
  23. }
  24.  
  25. this->update();
  26. }
  27.  
  28. void MainWindow::paintEvent( QPaintEvent* e )
  29. {
  30. Q_UNUSED( e );
  31.  
  32. QPainter p( this );
  33. p.drawEllipse( this->rect().center(), this->radius, this->radius );
  34. }
To copy to clipboard, switch view to plain text mode