code: def setExpanded(self, state):
          
          if (state and self.testFlag(self.ItemIsExpandable)) or \
             (not state and self.testFlag(self.ItemIsCollapsible)):
              super(XTreeWidgetItem, self).setExpanded(state)
docs: Sets whether or not this item is in an expanded state.
          
          :param      state | <bool>