本文整理汇总了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
示例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
示例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