Returns the query this widget is representing from the tree widget.
        
        :return     <Query> || <QueryCompound> || None

def query( self ):
        """
        Returns the query this widget is representing from the tree widget.
        
        :return     <Query> || <QueryCompound> || None
        """
        if ( not self.uiQueryCHK.isChecked() ):
            return None
        
        # build a query if not searching all
        q = Q()
        for i in range(self.uiQueryTREE.topLevelItemCount()):
            item = self.uiQueryTREE.topLevelItem(i)
            q &= item.query()
        return q