def setBrowerPath(self): download_path = QtWidgets.QFileDialog.getExistingDirectory(self, "浏览", "E:workspace") self.lineEdit.setText(download_path)
点击button “浏览”可以打开对应的文件目录,并将选定的文件目录写入 lineEdit文本框内。