'Return all selected items'

def selected_items(self):

    widget = self.widget
    if hasattr(widget, u'selectedItems'):
        return widget.selectedItems()
    else:
        item_from_index = widget.model().itemFromIndex
        return [item_from_index(i) for i in widget.selectedIndexes()]
