本文整理汇总了Python中PyQt4.QtGui.QFileDialog.getExistingDirectory方法的典型用法代码示例。如果您正苦于以下问题:Python QFileDialog.getExistingDirectory方法的具体用法?Python QFileDialog.getExistingDirectory怎么用?Python QFileDialog.getExistingDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QFileDialog
的用法示例。
在下文中一共展示了QFileDialog.getExistingDirectory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: changeFolder
# 需要导入模块: from PyQt4.QtGui import QFileDialog [as 别名]
# 或者: from PyQt4.QtGui.QFileDialog import getExistingDirectory [as 别名]
def changeFolder(self):
folder = QFileDialog.getExistingDirectory(self, "Select Folder", homedir)
if not folder.isEmpty():
self.folder = folder + "/"
self.labelFolder.setText(self.folder)
示例2: GetOutputFolderName
# 需要导入模块: from PyQt4.QtGui import QFileDialog [as 别名]
# 或者: from PyQt4.QtGui.QFileDialog import getExistingDirectory [as 别名]
def GetOutputFolderName(base_path=None, message='Select a folder:'):
if base_path is None:
base_path = tempfile.gettempdir()
dir = QFileDialog.getExistingDirectory(None, message, base_path, QFileDialog.ShowDirsOnly)
return dir
示例3: select_cache_dir
# 需要导入模块: from PyQt4.QtGui import QFileDialog [as 别名]
# 或者: from PyQt4.QtGui.QFileDialog import getExistingDirectory [as 别名]
def select_cache_dir(self):
cache_dir = QFileDialog.getExistingDirectory(
self.main_win,
self.settings.DLG_CAPTION,
self.settings.cache_dir,
QFileDialog.ShowDirsOnly | QFileDialog.DontResolveSymlinks
)
if '' == cache_dir:
self.util.msg_log('no cachedir selected')
else:
self.IDC_leCacheDir.setText(cache_dir)
示例4: getExistingDirectory
# 需要导入模块: from PyQt4.QtGui import QFileDialog [as 别名]
# 或者: from PyQt4.QtGui.QFileDialog import getExistingDirectory [as 别名]
def getExistingDirectory():
"""
Open a filedialog where you must choose a directory
:return: The selected directory
"""
return str(QFileDialog.getExistingDirectory(None, "Select Directory"))
示例5: open_browse
# 需要导入模块: from PyQt4.QtGui import QFileDialog [as 别名]
# 或者: from PyQt4.QtGui.QFileDialog import getExistingDirectory [as 别名]
def open_browse(self):
fname = QFileDialog.getExistingDirectory(self.dlg, "Select Directory")
self.dlg.lineEdit_6.setText(fname)
# noinspection PyMethodMayBeStatic