当前位置: 首页>>代码示例>>Python>>正文


Python QFileInfo.cd方法代码示例

本文整理汇总了Python中PyQt5.QtCore.QFileInfo.cd方法的典型用法代码示例。如果您正苦于以下问题:Python QFileInfo.cd方法的具体用法?Python QFileInfo.cd怎么用?Python QFileInfo.cd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.QFileInfo的用法示例。


在下文中一共展示了QFileInfo.cd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import cd [as 别名]
    def __init__(self, el, parent=None):
        super(MenuContentItem, self).__init__(parent)

        self.name = el.getAttribute("name")
        self.heading = None
        self.description1 = None
        self.description2 = None

        readme_dir = QFileInfo(__file__).dir()
        readme_dir.cdUp()
        readme_dir.cd(el.getAttribute("dirname"))

        self.readmePath = readme_dir.absoluteFilePath("README")

        self._prepared = False
开发者ID:Magdno1,项目名称:Arianrhod,代码行数:17,代码来源:menucontent.py

示例2: get_embedded_dir

# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import cd [as 别名]
def get_embedded_dir(root, *subdirs):
    """ Return a QDir corresponding to an embedded directory.  root is the root
    directory and will be the __file__ attribute of a pyqtdeploy module.
    subdirs is a sequence of sub-directories from the root.  Return None if no
    such directory exists.
    """

    qdir = QFileInfo(root).absoluteDir()

    for subdir in subdirs:
        if not qdir.cd(subdir):
            return None

    return qdir
开发者ID:doudz,项目名称:pyqtdeploy,代码行数:16,代码来源:file_utilities.py

示例3: resolveDir

# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import cd [as 别名]
    def resolveDir(self, name):
        dirName = self.info[name]['dirname']
        fileName = self.info[name]['filename'].split('/')

        dir = QFileInfo(__file__).dir()
        # To the 'examples' directory.
        dir.cdUp()

        dir.cd(dirName)

        if len(fileName) > 1:
            dir.cd('/'.join(fileName[:-1]))

        # This may legitimately fail if the example is just a simple .py file.
        dir.cd(fileName[-1])

        return dir
开发者ID:CarlosAndres12,项目名称:pyqt5,代码行数:19,代码来源:menumanager.py


注:本文中的PyQt5.QtCore.QFileInfo.cd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。