Important: Please read the Qt Code of Conduct -

Does QPainter tries to paint anything outside the size of paint device?

  • Hi, I am working on an algorithm for a line plot. I am drawing the line plot on a QImage. Due to zooming and scrolling the points to be drawn can be way outside of QImage boundary (sometimes by a factor of 10s of thousands). So, my question is, will QPainter waste any resource/computation time in trying to draw the points that lie outside of QImage? If yes, then while computing I will try to limit any point that lies outside of QImage, but if it doesn't waste any resource/computation time in drawing anything outside the boundary of QImage then I will not bother and save my computation time in limiting the point that lies outside the QImage boundary.

  • so write a test program, meter the performance of canvas writes vs out-of-bounds writes, and report back.

Log in to reply