Nominate our 2022 Qt Champions!

How to apply filter when using QDirIterator with PySide?

  • Hello,

    I'm trying to use the QDirIterator class combined with a filter in PySide. The recursive plotting of all the directories is working quite well. My problem is just that it doesn't apply a selected filter properly (ex. PySide.QtCore.QDir.NoDot).

    When I use a code similar to:
    from PySide.QtCore import (QDir, QDirIterator)

    path = QDir.currentPath()
    it = QDirIterator(path, QDir.Dirs | QDir.NoDotAndDotDot, QDirIterator.Subdirectories)
    while it.hasNext():

    it still prints the ".", ".." and all files. What am I doing wrong?

    Thank you in advance for your help!

Log in to reply