title: qpainter painting alternatives (performance sucks on Mac)
body: <p>I have a class which displays waveform data of audiofiles in a QWidget (see screenshot of the widget below, back then i still used a gradient, which caused poor performance). </p>
  
  <p>The audio data is painted in the paintEvent directly on the widget using multiple calls to <code>QPainter::drawLine</code> (the minimum amount of calls to <code>QWidget::drawLine</code> is equivalent to the width of the widget => at least one line for each x coordinate).
  While the approach works quite well on Windows (a paintEvent in fullscreen takes around ~4ms), the performance is 4-5 times worse when the program is run under MacOS.</p>
  
  <p>The performance of the painting is important for fluid scrolling of the displayed data.</p>
  
  <p>So my question is, does anyone know a faster alternative to QPainter.drawLine to paint lines (platform dependant solutions might be ok, as long as they can be used in a paintEvent), or is there a way to speed up scrolling, some kind of buffering etc ?</p>
  
  <p><img src="https://i.stack.imgur.com/5Pg3L.png" alt="old screenshot of the widget (still used gradients, which caused poor performance)"></p>