Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QDirIterator not working with flags ;/

    Qt for Python
    pyside2
    2
    4
    244
    Loading More Posts
    • 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
      Dariusz last edited by 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)
      
      eyllanesc 1 Reply Last reply Reply Quote 0
      • eyllanesc
        eyllanesc @Dariusz last edited by

        @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 Reply Quote 0
        • D
          Dariusz last edited by

          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.

          eyllanesc 1 Reply Last reply Reply Quote 0
          • eyllanesc
            eyllanesc @Dariusz last edited by eyllanesc

            @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 Reply Quote 3
            • First post
              Last post