• PySide 模块
  • PySide.QtCore
  • 内容表

    上一话题

    QAbstractFileEngine

    下一话题

    QDir

    QFSFileEngine

    概要

    函数

    静态函数

    详细描述

    PySide.QtCore.QFSFileEngine class implements Qt's default file engine.

    This class is part of the file engine framework in Qt. If you only want to access files or directories, use PySide.QtCore.QFile , PySide.QtCore.QFileInfo or PySide.QtCore.QDir 代替。

    PySide.QtCore.QFSFileEngine is the default file engine for accessing regular files. It is provided for convenience; by subclassing this class, you can alter its behavior slightly, without having to write a complete PySide.QtCore.QAbstractFileEngine subclass. To install your custom file engine, you must also subclass PySide.QtCore.QAbstractFileEngineHandler and create an instance of your handler.

    It can also be useful to create a PySide.QtCore.QFSFileEngine object directly if you need to use the local file system inside QAbstractFileEngine.create() , in order to avoid recursion (as higher-level classes tend to call QAbstractFileEngine.create() ).

    class PySide.QtCore. QFSFileEngine
    class PySide.QtCore. QFSFileEngine ( file )
    参数: file – unicode

    构造 PySide.QtCore.QFSFileEngine .

    构造 PySide.QtCore.QFSFileEngine for the file name file .

    static PySide.QtCore.QFSFileEngine. currentPath ( [ path="" ] )
    参数: path – unicode
    返回类型: unicode

    For Unix, returns the current working directory for the file engine.

    For Windows, returns the canonicalized form of the current path used by the file engine for the drive specified by fileName . On Windows, each drive has its own current directory, so a different path is returned for file names that include different drive names (e.g. A: or C:).

    static PySide.QtCore.QFSFileEngine. drives ( )
    返回类型:

    For Windows, returns the list of drives in the file system as a list of PySide.QtCore.QFileInfo objects. On unix, Mac OS X and Windows CE, only the root path is returned. On Windows, this function returns all drives (A:, C:, D:, etc.).

    For Unix, the list contains just the root path “/”.

    PySide.QtCore.QFSFileEngine. endEntryList ( )
    返回类型: PySide.QtCore.QAbstractFileEngineIterator
    static PySide.QtCore.QFSFileEngine. homePath ( )
    返回类型: unicode

    Returns the home path of the current user.

    PySide.QtCore.QFSFileEngine. open ( flags , fd )
    参数:
    • flags PySide.QtCore.QIODevice.OpenMode
    • fd PySide.QtCore.int
    返回类型:

    PySide.QtCore.bool

    PySide.QtCore.QFSFileEngine. open ( flags , fd , handleFlags )
    参数:
    • flags PySide.QtCore.QIODevice.OpenMode
    • fd PySide.QtCore.int
    • handleFlags PySide.QtCore.QFile.FileHandleFlags
    返回类型:

    PySide.QtCore.bool

    static PySide.QtCore.QFSFileEngine. rootPath ( )
    返回类型: unicode

    Returns the root path.

    static PySide.QtCore.QFSFileEngine. setCurrentPath ( path )
    参数: path – unicode
    返回类型: PySide.QtCore.bool

    Sets the current path (e.g., for PySide.QtCore.QDir ), to path . Returns true if the new path exists; otherwise this function does nothing, and returns false.

    static PySide.QtCore.QFSFileEngine. tempPath ( )
    返回类型: unicode

    Returns the temporary path (i.e., a path in which it is safe to store temporary files).