title: Get list of points affected by drawLine() or QLineF
body: <p>How do I get a list of points/coordinates that the drawLine() function affects? For example if I have </p>
  
  <pre><code>QLineF line(10.0, 80.0, 90.0, 20.0);
  QPainter(this);
  painter.drawLine(line);
  </code></pre>
  
  <p>I want to get the list of QPoint coordinates that the drawLine() will draw. I'm aware of <a href="http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm" rel="nofollow noreferrer">Bresenham's line algorithm</a>, however I need this to work in a more general case where I can set different QPen and QBrush:</p>
  
  <pre><code>painter.setPen(QPen(myColor, myWidth, Qt::SolidLine, Qt::RoundCap));
  </code></pre>
  
  <p>I also need it to be consistent with other programs that might draw lines with same end points and parameters, but without Qt, so I want to end up with the same result, and without off-by-one differences.</p>
  
  <p>Note: This is different from <a href="https://stackoverflow.com/questions/9680294/how-to-trace-the-missing-pixels-when-using-drawline">this question</a>, because I need ALL pixels that are going to be affected by the drawing function, not just the vertices of polygon/path.</p>
  
  <p><strong>Update</strong>: I think it is possible to subclass QImage or QPainterDevice and QPaintEngine to catch all "setPixel()" operations. Could anyone prove otherwise or confirm and maybe even write a short code to do that?</p>