Hi

I am trying to traverse a directory so I made the following code:

Qt Code:
  1. QDir root("c:\\Qt");
  2.  
  3. qDebug() << "dirName(): " << root.dirName() << ", absolutePath(): " << root.absolutePath();
  4.  
  5. //http://doc.trolltech.com/4.4/qdir.html#Filter-enum
  6. QFileInfoList fList = root.entryInfoList(QDir::NoDotAndDotDot, QDir::DirsFirst);
  7.  
  8. for(int i=0;i < fList.size(); ++i)
  9. {
  10. QFileInfo file = fList.at(i);
  11. if(file.isDir())
  12. qDebug() << "- (dir): " << file.absoluteFilePath();
  13. else
  14. qDebug() << "- : " << file.absoluteFilePath();
  15. }
To copy to clipboard, switch view to plain text mode 

However, this returns an empty list. If I disabled the NoDotAndDotDot filter it show the directory correctly (including the dot and dotdot I want to filter). Anyone know what I am doing wrong? Perhaps I have misinterpreted the function of the NoDotAndDotDot filter?

I appreciate any feedback on this issue. Thanks!