本文整理汇总了Python中Core.Universals.getLastPathByEvent方法的典型用法代码示例。如果您正苦于以下问题:Python Universals.getLastPathByEvent方法的具体用法?Python Universals.getLastPathByEvent怎么用?Python Universals.getLastPathByEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.Universals
的用法示例。
在下文中一共展示了Universals.getLastPathByEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getOpenFileNames
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import getLastPathByEvent [as 别名]
def getOpenFileNames(_caption, _directory, _filter, _isUseLastPathKeyType=1, _lastPathKey=None):
pathKey = uni.getLastPathKey(_caption, _directory, _filter, _isUseLastPathKeyType, _lastPathKey)
if pathKey is not None: _directory = uni.getLastPathByEvent(pathKey, _directory)
filePaths = QFileDialog.getOpenFileNames(getActiveWindow(), str(_caption),
str(_directory), str(_filter))
if not filePaths:
return None
if pathKey is not None: uni.setLastPathByEvent(pathKey, str(filePaths[-1]))
return list(filePaths)
示例2: getExistingDirectory
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import getLastPathByEvent [as 别名]
def getExistingDirectory(_caption, _directory, _isUseLastPathKeyType=1, _lastPathKey=None):
pathKey = uni.getLastPathKey(_caption, _directory, "", _isUseLastPathKeyType, _lastPathKey)
if pathKey is not None: _directory = uni.getLastPathByEvent(pathKey, _directory)
filePath = QFileDialog.getExistingDirectory(getActiveWindow(), str(_caption),
str(_directory))
if filePath == "":
return None
if pathKey is not None: uni.setLastPathByEvent(pathKey, str(filePath))
return str(filePath)
示例3: getSaveFileName
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import getLastPathByEvent [as 别名]
def getSaveFileName(_caption, _directory, _filter=None, _isUseLastPathKeyType=1, _lastPathKey=None):
if _filter is None:
if fu.isFile(_directory):
fileExt = fu.getFileExtension(_directory)
if fileExt != "":
_filter = "*.%s (*.%s)" % (fileExt, fileExt)
else:
_filter = "*.* (*.*)"
else:
_filter = "*.* (*.*)"
pathKey = uni.getLastPathKey(_caption, _directory, _filter, _isUseLastPathKeyType, _lastPathKey)
if pathKey is not None: _directory = uni.getLastPathByEvent(pathKey, _directory)
filePath = QFileDialog.getSaveFileName(getActiveWindow(), str(_caption),
str(_directory), str(_filter))
if filePath == "":
return None
if pathKey is not None: uni.setLastPathByEvent(pathKey, str(filePath))
return str(filePath)