Exemplo n.º 1
0
    def changeEvent(self, event):
        """When font changes, resize the rows and columns so things fit OK"""

        # Can't resize the window from here unless we kept a parent ref, but it's
        # better that way anyway, since many users will want to manually resize the window
        # Also, we might not be the only widget in the window

        # So anyway, just size the rows and columns
        if event.type() == QEvent.FontChange:
            self.resizeRowsToContents()
            self.resizeColumnsToContents()
            self.update()
        QTableView.changeEvent(self, event)