def __collectFilterTerms( self, 
                            mapping, 
                            item = None, 
                            level = 0 ):
        """
        Generates a list of filter terms based on the column data for the \
        items in the tree.  If no parent is supplied, then the top level items \
        will be used, otherwise the children will be searched through.  The \
        level value will drive how far down the tree we will look for the terms.
        
        :param      mapping | {<int> column: <set> values, ..}
                    item    | <QtGui.QTreeWidgetItem> || None
                    level   | <int>
        """
        if not mapping:
            return
        
        max_level = self.maximumFilterLevel()
        if max_level != None and level > max_level:
            return False
        
        if not item:
            for i in range(self.topLevelItemCount()):
                self.__collectFilterTerms(mapping, self.topLevelItem(i))
        else:
            # add the item data to the mapping
            for index in mapping.keys():
                text = nativestring(item.text(index))
                if not text:
                    continue
                    
                mapping[index].add(text)
            
            for c in range(item.childCount()):
                self.__collectFilterTerms(mapping, item.child(c), level + 1)