本文整理汇总了Python中PyQt5.QtCore.QFileInfo.cdUp方法的典型用法代码示例。如果您正苦于以下问题:Python QFileInfo.cdUp方法的具体用法?Python QFileInfo.cdUp怎么用?Python QFileInfo.cdUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.QFileInfo
的用法示例。
在下文中一共展示了QFileInfo.cdUp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import cdUp [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: resolveDir
# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import cdUp [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