(self)
Select the diagonal elements of the matrix
Select the diagonal elements of the matrix
Select the diagonal elements of the matrix
def select_correct(self):
        """Select the diagonal elements of the matrix"""
        selection = QItemSelection()
        n = self.tablemodel.rowCount()
        for i in range(2, n):
            index = self.tablemodel.index(i, i)
            selection.select(index, index)
        self.tableview.selectionModel().select(
            selection, QItemSelectionModel.ClearAndSelect)
def select_correct ( self ) : selection = QItemSelection ( ) n = self . tablemodel . rowCount ( ) for i in range ( 2 , n ) : index = self . tablemodel . index ( i , i ) selection . select ( index , index ) self . tableview . selectionModel ( ) . select ( selection , QItemSelectionModel . ClearAndSelect )