Skip to content

DirIterator

Qt Base Class: QDirIterator

Signature: QDirIterator(self, dir: Union[PySide6.QtCore.QDir, str], flags: PySide6.QtCore.QDirIterator.IteratorFlag = Instance(PySide6.QtCore.QDirIterator.IteratorFlag.NoIteratorFlags)) -> None QDirIterator(self, path: str, filter: PySide6.QtCore.QDir.Filter, flags: PySide6.QtCore.QDirIterator.IteratorFlag = Instance(PySide6.QtCore.QDirIterator.IteratorFlag.NoIteratorFlags)) -> None QDirIterator(self, path: str, flags: PySide6.QtCore.QDirIterator.IteratorFlag = Instance(PySide6.QtCore.QDirIterator.IteratorFlag.NoIteratorFlags)) -> None QDirIterator(self, path: str, nameFilters: Sequence[str], filters: PySide6.QtCore.QDir.Filter = Instance(QDir.NoFilter), flags: PySide6.QtCore.QDirIterator.IteratorFlag = Instance(PySide6.QtCore.QDirIterator.IteratorFlag.NoIteratorFlags)) -> None

Base classes

Name Children Inherits
QDirIterator
PySide6.QtCore
QDirIterator(self, dir: Union[PySide6.QtCore.QDir, str], flags: PySide6.QtCore.QDirIterator.IteratorFlag \= Instance(PySide6.QtCore.QDirIterator.IteratorFlag.NoIteratorFlags)) -> None

⋔ Inheritance diagram

graph TD
  1473299889200["core.DirIterator"]
  1473288942768["QtCore.QDirIterator"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473288942768 --> 1473299889200
  1473291690208 --> 1473288942768
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QDirIterator

Iterator for directory entrylists.

Source code in prettyqt\core\diriterator.py
class DirIterator(core.QDirIterator):
    """Iterator for directory entrylists."""

    def __iter__(self):
        return self

    def __next__(self):
        if self.hasNext():
            return self.next()
        raise StopIteration

    def get_file_path(self) -> pathlib.Path:
        return pathlib.Path(self.filePath())

    def get_file_info(self) -> core.FileInfo:
        return core.FileInfo(self.fileInfo())