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] Expanding wildcards in directory paths

[SOLVED] Expanding wildcards in directory paths

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.9k 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.
  • K Offline
    K Offline
    kierans
    wrote on last edited by
    #1

    I'm a newbie to C++/Qt.

    Looking at the docs for QDir, one can filter for a "type" of file (eg: *.txt) however can QDir expand wildcards in the path?

    For example if I have the following dir structure:
    @
    foo
    -> bar
    -> one.txt
    -> two.txt
    @
    If I was above foo, and wanted to find foo//.txt how would one do it with QDir? Is it even possible? Or would I have to do a manual walk over the segments in the path?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcari
      wrote on last edited by
      #2

      I think you will have to walk through the children manually because QDir only display its direct child nodes in the filesystem.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        You will have to manually walk through the subdirs. For filtering, have a look at "QDir::entryInfoList() ":http://doc.qt.nokia.com/4.7/qdir.html#entryInfoList

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kierans
          wrote on last edited by
          #4

          Thanks guys. I've already begun code to manually walk the subdirs. It would be a nice feature to have in QDir of course ;)

          1 Reply Last reply
          0

          • Login

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