Results 1 to 2 of 2

Thread: qdir and entrylist

  1. #1
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default qdir and entrylist

    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

  2. #2
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qdir and entrylist

    Try this:
    Qt Code:
    1. #include <QtCore>
    2.  
    3. int main(int argc, char* argv[])
    4. {
    5. QDir dir;
    6. QStringList l = dir.entryList(QDir::NoDotAndDotDot|QDir::AllEntries);
    7.  
    8. qDebug() << l;
    9. return 0;
    10. }
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to DeepDiver for this useful post:

    HAMIDx9 (23rd February 2012)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.