How do I get a list of points/coordinates that the drawLine() function affects? For example if I have
QLineF line(10.0, 80.0, 90.0, 20.0);
QPainter(this);
painter.drawLine(line);
I want to get the list of QPoint coordinates that the drawLine() will draw. I'm aware of Bresenham's line algorithm, however I need this to work in a more general case where I can set different QPen and QBrush:
painter.setPen(QPen(myColor, myWidth, Qt::SolidLine, Qt::RoundCap));
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.
Note: This is different from this question, because I need ALL pixels that are going to be affected by the drawing function, not just the vertices of polygon/path.
Update: 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?