Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]QDir::EntryList

[SOLVED]QDir::EntryList

Scheduled Pinned Locked Moved General and Desktop
qdir
3 Posts 2 Posters 5.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GrahamL
    wrote on 24 Jul 2015, 09:40 last edited by GrahamL
    #1

    Hi
    If I want to get a list of all files and sub folders in a folder, but excluding dot and dotdot I thought that this should do the trick

    QDir myDir("somepath");
    QStringList files = myDir.entryList(QDir::NoDotAndDotDot);
    

    However, this seems to return no strings
    Removing the filter returns the list as expected but including dot and dotdot

    Is this the correct behavior or have I misunderstood something?

    Thanks

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 24 Jul 2015, 09:57 last edited by
      #2
      QDir myDir("somepath");
      QStringList files = myDir.entryList(QDir::AllEntries|QDir::NoDotAndDotDot);
      

      This should work. You need to specify what you want to see and than you add what should be excluded.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      1
      • G Offline
        G Offline
        GrahamL
        wrote on 24 Jul 2015, 10:03 last edited by
        #3

        Ahh Ok

        Thanks

        1 Reply Last reply
        0

        1/3

        24 Jul 2015, 09:40

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved