def setQuery( self, query ):
        """
        Assigns the query for this widget, loading the query builder tree with
        the pertinent information.
        
        :param      query | <Query> || <QueryCompound> || None
        """
        tree = self.uiQueryTREE
        tree.blockSignals(True)
        tree.setUpdatesEnabled(False)
        
        tree.clear()
        
        # assign a top level query item
        if ( Q.typecheck(query) and not query.isNull() ):
            XQueryItem(tree, query)
        
        # assign a top level query group
        elif ( QueryCompound.typecheck(query) and not query.isNull() ):
            op_name = QueryCompound.Op[query.operatorType()].lower()
            
            for i, sub_query in enumerate(query.queries()):
                if ( i ):
                    XJoinItem(tree, op_name)
                
                XQueryItem(tree, sub_query)
            
        tree.resizeToContents()
        tree.setUpdatesEnabled(True)
        tree.blockSignals(False)