Skip to content

FileSystemWatcher

Qt Base Class: QFileSystemWatcher

Signature: QFileSystemWatcher(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None QFileSystemWatcher(self, paths: Sequence[str], parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QFileSystemWatcher
PySide6.QtCore
QFileSystemWatcher(self, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473299870656["core.FileSystemWatcher"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473288911536["QtCore.QFileSystemWatcher"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473299870656
  140713234304496 --> 1473299815024
  1473288911536 --> 1473299870656
  1473288842240 --> 1473288911536
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ObjectMixin, QFileSystemWatcher

Interface for monitoring files and directories for modifications.

Source code in prettyqt\core\filesystemwatcher.py
class FileSystemWatcher(core.ObjectMixin, core.QFileSystemWatcher):
    """Interface for monitoring files and directories for modifications."""

    def __repr__(self):
        return get_repr(self, self.directories() + self.files())

    def get_directories(self) -> list[pathlib.Path]:
        return [pathlib.Path(p) for p in self.directories()]

    def get_files(self) -> list[pathlib.Path]:
        return [pathlib.Path(p) for p in self.files()]

    def get_paths(self) -> list[pathlib.Path]:
        return self.get_directories() + self.get_files()

    def add_path(self, path: datatypes.PathType) -> bool:
        return self.addPath(os.fspath(path))

    def add_paths(self, paths: Iterable[datatypes.PathType]):
        self.addPaths([os.fspath(p) for p in paths])

⌗ Property table

Qt Property Type Doc
objectName QString