title: Qt updating displayed QImage
body: <p>I acquire images from a camera by using a SDK which returns the data in an unsigned char array. However this SDK doesn't offer functionality to display the data, so I tried to implement this by using Qt 4.8 under Ubuntu 12.04.</p>
  
  <p>At the moment my code looks like this:</p>
  
  <pre><code>#include &lt;QtGui/QApplication&gt;
  #include &lt;QGraphicsScene&gt;
  #include &lt;QGraphicsView&gt;
  #include &lt;QGraphicsPixmapItem&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      QGraphicsScene scene;
      QGraphicsView view(&amp;scene);
  
      while (..) // condition which breaks after a number of images where grabbed
      {
          // Get the image from the third party SDK into an unsigned char array
          // named pImageBuffer
  
          QImage image ((unsigned char *) pImageBuffer, 
              GetWidth(), 
              GetHeight(), 
              QImage::Format_Indexed8);
  
          QVector&lt;QRgb&gt; colorTable(256);
          for(int i=0;i&lt;256;i++)
              colorTable[i] = qRgb(i,i,i);
          image.setColorTable(colorTable);
  
          QPixmap pixmap = QPixmap::fromImage(image);
          QGraphicsPixmapItem *item = new QGraphicsPixmapItem(pixmap);
          scene.addItem(item);
  
          view.show();
          a.exec();
      }
  }
  </code></pre>
  
  <p>This works like expected, the images are displayed properly. However a.exec() blocks the main thread until I close the QtWindow.</p>
  
  <p>Is there any easy way to modify this, so the window stays open all the time and just updates the displayed image? Performance doesn't matter at all at the moment, but I need to keep the code simple.</p>