'Set the flattening mode.'

def setFlatteningMode(self, mode):

    if (mode != self.__flatteningMode):
        self.beginResetModel()
        self.__flatteningMode = mode
        self._updateRowMapping()
        self.endResetModel()
