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


Python Universals.getLastPathByEvent方法代码示例

本文整理汇总了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)
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:11,代码来源:Dialogs.py

示例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)
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:11,代码来源:Dialogs.py

示例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)
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:20,代码来源:Dialogs.py


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