Qt文件夹遍历

void FindFile(const QString &_filepath)

{

  QDir dir(_filepath);

  for each (QFileInfo mfile in dir.entryInfoList())

  {

    if(mfile.isFile())

    {

      qinfo()<<mfile.fileName();

    }

    else

    {

      if(mfile.fileName()=="."||mfile.fileName()=="..") continue;

      qinfo()<<“进入文件夹:”<<mfile.absoluteFilePath();

      FindFile(mfile.absoluteFilePath());

    }

  }

}

上一篇:VC++中的文件操作基本方法


下一篇:java.io.IOException: Could not find resource com/xxx/xxxMapper.xml