code: def _detect(env):
      
      QTDIR = None
      if not QTDIR:
          QTDIR = env.get('QTDIR',None)
      if not QTDIR:
          QTDIR = os.environ.get('QTDIR',None)
      if not QTDIR:
          moc = env.WhereIs('moc')
          if moc:
              QTDIR = os.path.dirname(os.path.dirname(moc))
              SCons.Warnings.warn(
                  QtdirNotFound,
                  "Could not detect qt, using moc executable as a hint (QTDIR=%s)" % QTDIR)
          else:
              QTDIR = None
              SCons.Warnings.warn(
                  QtdirNotFound,
                  "Could not detect qt, using empty QTDIR")
      return QTDIR
docs: Not really safe, but fast method to detect the QT library