def get_task_from_tree_view(self, tree_view):
        """returns the task object from the given QTreeView
        """
        task = None
        selection_model = tree_view.selectionModel()

        indexes = selection_model.selectedIndexes()

        if indexes:
            current_index = indexes[0]

            item_model = tree_view.model()
            current_item = item_model.itemFromIndex(current_index)

            if current_item:
                try:
                    task = current_item.task
                except __HOLE__:
                    pass

        return task
dataset/ETHPy150Open eoyilmaz/anima/anima/ui/version_mover.py/VersionMover.get_task_from_tree_view