def start_capture(self):
        """Start capturing the rectangle."""
        previous_map_tool = self.canvas.mapTool()
        if previous_map_tool != self.tool:
            self.previous_map_tool = previous_map_tool
        self.canvas.setMapTool(self.tool)
        self.hide()
def start_capture ( self ) : previous_map_tool = self . canvas . mapTool ( ) if previous_map_tool != self . tool : self . previous_map_tool = previous_map_tool self . canvas . setMapTool ( self . tool ) self . hide ( )
Start capturing the rectangle.