def setFitToWindow(self, fit=True):
        """ setFitToWindow(fit: boolean) -> None
        Force to fit all cells into the visible area. Set fit=False
        for the scroll mode where hidden cell can be viewed by scrolling
        the scrollbars.

        """
        if fit!=self.fitToWindow:
            self.fitToWindow = fit
            self.horizontalHeader().fitToWindow = fit
            self.horizontalHeader()._target_size = None
            self.verticalHeader().fitToWindow = fit
            self.verticalHeader()._target_size = None
            if not fit:
                width = self.columnWidth(self.columnCount()-1)
                height = self.rowHeight(self.rowCount()-1)

                self.setColumnWidth(self.columnCount()-1, width)
                self.setRowHeight(self.rowCount()-1, height)
            self.stretchCells()
            policy = (QtCore.Qt.ScrollBarAlwaysOff if fit
                      else QtCore.Qt.ScrollBarAlwaysOn)
            self.setHorizontalScrollBarPolicy(policy)
            self.setVerticalScrollBarPolicy(policy)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/spreadsheet/spreadsheet_sheet.py/StandardWidgetSheet.setFitToWindow/original