'Returns a list of (category, row) representing the tree selection.'

def selected_indexes(self):

    selected = self.selectedIndexes()
    result = []
    for idx in selected:
        if idx.parent().isValid():
            parent_idx = idx.parent()
            entry = (parent_idx.row(), idx.row())
        else:
            entry = (self.idx_header, idx.row())
        result.append(entry)
    return result
