0
我想檢索所選路徑的字符串變量。PyQt:如何從對話框函數返回一個變量?
class ExampleApp(QtGui.QMainWindow, design.Ui_MainWindow):
def __init__(self):
super(self.__class__, self).__init__()
self.setupUi(self)
A = self.in_browse_button.clicked.connect(self.browser)
def browser(self):
global directory
directory = str(QFileDialog.getExistingDirectory())
self.input_edit.setText(directory)
return directory
對話框打開,當我按下按鈕,但是當我嘗試使用一個變量它的值是無。任何想法?