Expands all the parents of this item to ensure that it is visible
        to the user.

def ensureVisible(self):
        """
        Expands all the parents of this item to ensure that it is visible
        to the user.
        """
        parent = self.parent()
        while parent:
            parent.setExpanded(True)
            parent = parent.parent()