PDA

View Full Version : qdir and entrylist



mattia
28th November 2007, 08:37
Hi, i want to read some folders name .
myDirectory is a QDir object that point to my file system.

QStringList stringList = myDirectory.entryList ( QDir::NoDotAndDotDot );

why can i catch "." and ".." in stringList? Shouldn't be out of list?
Anyway i want to read all the directory except "." and ".."
thx

DeepDiver
28th November 2007, 10:13
Try this:




#include <QtCore>

int main(int argc, char* argv[])
{
QDir dir;
QStringList l = dir.entryList(QDir::NoDotAndDotDot|QDir::AllEntrie s);

qDebug() << l;
return 0;
}