code: def query( self ):
          
          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
docs: Returns the query this widget is representing from the tree widget.
          
          :return     <Query> || <QueryCompound> || None