Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QDirIterator not working with flags ;/
QtWS25 Last Chance

QDirIterator not working with flags ;/

Scheduled Pinned Locked Moved Unsolved Qt for Python
pyside2
4 Posts 2 Posters 550 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by Dariusz
    #1

    Hey
    I can't get it to work, what's wrong >

    it = QDirIterator(dirPath, QDir.NoDotAndDotDot, QDirIterator.Subdirectories)
    

    Dat gives me empty stuff

    Regards
    Dariusz

    I also cant get this to print anything>

    it = QDirIterator(dirPath, ["*.exr"], filters=QDir.NoDotAndDotDot, flags=QDirIterator.NoIteratorFlags)
    
    eyllanescE 1 Reply Last reply
    0
    • D Dariusz

      Hey
      I can't get it to work, what's wrong >

      it = QDirIterator(dirPath, QDir.NoDotAndDotDot, QDirIterator.Subdirectories)
      

      Dat gives me empty stuff

      Regards
      Dariusz

      I also cant get this to print anything>

      it = QDirIterator(dirPath, ["*.exr"], filters=QDir.NoDotAndDotDot, flags=QDirIterator.NoIteratorFlags)
      
      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @Dariusz your question is unclear

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dariusz
        wrote on last edited by
        #3

        the result is empty, if I remove NoDotAndDotDot I get result. So for some reason asking it to remove /. and /.. cause it to return empty.

        eyllanescE 1 Reply Last reply
        0
        • D Dariusz

          the result is empty, if I remove NoDotAndDotDot I get result. So for some reason asking it to remove /. and /.. cause it to return empty.

          eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by eyllanesc
          #4

          @Dariusz Filters are flags so if you want to get directories and not dotanddots then use:

          it = QDirIterator(
              dirPath, QDir.Dirs | QDir.NoDotAndDotDot, flags=QDirIterator.Subdirectories
          )
          

          If you want files:

          it = QDirIterator(
              dirPath, QDir.Files | QDir.NoDotAndDotDot, flags=QDirIterator.Subdirectories
          )
          

          Same:

          it = QDirIterator(
              dirPath, ["*.exr"], filters=QDir.Files | QDir.NoDotAndDotDot, flags=QDirIterator.NoIteratorFlags
          )
          

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          1 Reply Last reply
          3

          • Login

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