title: QPaintEvent - updating only a region of the screen
body: <p>in my code I'm trying to draw points every time my app gets GPS coordinates. The points are moved by &quot;i&quot; pixels to the right and down. I would like them to stay there drawn but it seems like the whole screen is always updated, even though I'm using a QRegion parameter which is meant to specify an area on the screen which should be updated. Is there anyone who could help, please? I'm really new at this and have no idea what is wrong.</p>
  <p>Here is the class which handles this action:</p>
  <pre><code>GameField::GameField(QWidget *parent)
      : QWidget(parent)
  {
     i=5;
     j=0;
     pen=new QPen(Qt::black, 1, Qt::SolidLine);
     painter= new QPainter(this);
  }
  
  void GameField::paintEvent(QPaintEvent *event)
  {
  
  painter.setPen(pen);
  painter.drawPoint(i,i,1,1);
  
  
    }
  
  void GameField::positionUpdated(QGeoPositionInfo position) {
    QGeoCoordinate coordinates;
    if (position.isValid()) {
      coordinates = position.coordinate();
    }
  i=i+5;
  QRegion region(QRect(i,i,5,5));
  this-&gt;update(region);
    }
  </code></pre>