def METHOD_NAME(self, style):
    style = style.lower()
    selectionModel = self.list.selectionModel()
    parent = QModelIndex()
    self.rows = self.model.rowCount(parent) - 1
    if style == 'last':
        self.row = self.rows
    elif style == 'first':
        self.row = 0
    elif style == 'up':
        if self.row > 0:
            self.row -= 1
        else:
            self.row = 0
    elif style == 'down':
        if self.row < self.rows:
            self.row += 1
        else:
            self.row = self.rows
    else:
        return
    top = self.model.index(self.row, 0, parent)
    bottom = self.model.index(self.row, 0, parent)
    selectionModel.setCurrentIndex(top, QItemSelectionModel.Select | QItemSelectionModel.Rows)
    selection = QItemSelection(top, top)
    selectionModel.clearSelection()
    selectionModel.select(selection, QItemSelectionModel.Select)