title: Accelerate 2d Drawing
body: <p>I'm triying to make a 2D real-time plot. I've tried with modifying the osciloscope example of qwt, tried to use QGraphicsView, and QPainter to reach high framerate drawing. I'm using 8 channels to plot data wich is arriving from a rs232 port. I take a sample every 10 ms.
  Maybe i've used the QPainter in a wrong way, but i couldn't draw very fast. With the qwt example, in wich doesn't update the whole screen the drawing speed was good, especially in X11 with Qt::WA_PaintOutsidePaintEvent and Qt::WA_PaintOnScreen.</p>
  
  <p>Now i'm subclassing the QGLWidget, and i'm reaching a acceptable speed. But i'm wondering if i could improve it.</p>
  
  <p>Every time I recived a new point i stored it, and the call updateGL();
  In this case i recived only the y coordinate, buth i'm going to recive the whole pair.</p>
  
  <pre><code>void Plot::addPoint(int y)
  {
     points[t].x=t;
     points[t].y=y;
     t++;
     updateGL();
  }
  </code></pre>
  
  <p>In DrawGL() i check if the line reach the end of the screen, if is True i erase the screen
  if not, i draw only the the new part of the line.</p>
  
  <pre><code>  glBegin(GL_LINES);
      glVertex2i( points[t-1].x, points[t-1].y);
      glVertex2i( points[t-2].x, points[t-2].y);
   glEnd();
  </code></pre>
  
  <p>I've disabled the Dithering and multisampling, and i'm using flat shades.
  i'm using an ortographic projection.</p>
  
  <p>is there some way to draw faster? maybe using opengl for off-screen drawing and the showing the corresponding pixmap?
  is the a project similar to this?</p>