本文整理汇总了Python中python_qt_binding.QtGui.QFileDialog.getExistingDirectory方法的典型用法代码示例。如果您正苦于以下问题:Python QFileDialog.getExistingDirectory方法的具体用法?Python QFileDialog.getExistingDirectory怎么用?Python QFileDialog.getExistingDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类python_qt_binding.QtGui.QFileDialog
的用法示例。
在下文中一共展示了QFileDialog.getExistingDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: browseForFolder
# 需要导入模块: from python_qt_binding.QtGui import QFileDialog [as 别名]
# 或者: from python_qt_binding.QtGui.QFileDialog import getExistingDirectory [as 别名]
def browseForFolder(self):
location = QFileDialog.getExistingDirectory(directory=os.path.dirname(self.demoLocation.text()))
if len(location) == 0:
return
self.demoLocation.setText(location)
self.loadLocation()
示例2: load_directory
# 需要导入模块: from python_qt_binding.QtGui import QFileDialog [as 别名]
# 或者: from python_qt_binding.QtGui.QFileDialog import getExistingDirectory [as 别名]
def load_directory(self):
directory = QFileDialog.getExistingDirectory(self, self.tr("Open Directory"), "../")
self.filenames.extend(os.listdir(directory))
temp = [directory + '/' + filepath for filepath in os.listdir(directory)]
self.filelist.extend(temp)
self.fileLabel.setText('Files: ' + str(self.filenames))
self.fileLabel.setWordWrap(True)