I got number of QgsRectangles and i want to save images bounded by them.
Code written in python:
for box in self.boxes:
xs = [box[0][0],box[1][0],box[2][0],box[3][0]]
ys = [box[0][1],box[1][1],box[2][1],box[3][1]]
min_x = min(xs)
min_y = min(ys)
max_x = max(xs)
max_y = max(ys)
box = QgsRectangle(min_x,min_y,max_x,max_y)
self.iface.mapCanvas().setExtent(box)
self.iface.mapCanvas().refresh()
time.sleep(1)
self.utils.iface.mapCanvas().saveAsImage('%s.tiff' %(str(min_x)))
The problem is script walks over all my boxes, but extents are set only for the last one. I thought qgis will set extents, show location of my box and save an image associated with it.

