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. How to apply filter when using QDirIterator with PySide?
Qt 6.11 is out! See what's new in the release blog

How to apply filter when using QDirIterator with PySide?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 943 Views 1 Watching
  • 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.
  • P Offline
    P Offline
    pytobias
    wrote on last edited by
    #1

    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():
    print it.next()
    @

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

    Thank you in advance for your help!

    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