QDir::entryInfoList returns wrong results

  • Why does the following Qt 4.8.2's code:

    const QDir dir( ... );
    const QList< QFileInfo > dirs = dir.entryInfoList( QDir::AllDirs );

    ... returns not only the directories inside dir but the dir's path and its parent folder's path?

  • Because the directory <code>.</code> and the parent directory <code>..</code> are directory entries as well. If you do not want them to be listed use <code>QDir::NoDotAndDotDot</code>.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.