tutor@python.org Hello, I am trying to write a UI for my utility, using QT-Python. I first launch a GUI and click on a toolButton to open up the directory structure, from which I select a particular file.
self.fileDialog = QtGui.QFileDialog() QtCore.QObject.connect(self.toolButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.fileDialog.getOpenFileName) So far so good. How do I store the return value of getOpenFileName? For example, if I do the following, it gives error: QtCore.QObject.connect(self.toolButton, QtCore.SIGNAL(_fromUtf8("clicked()")), (filepath=self.fileDialog.getOpenFileName)) The reason I want to store the return value is because I want to capture the filename/path that getOpenFilename returned in a string so I can copy it to a lineEdit space as below: self.lineEdit.setText(filepath) text = self.lineEdit.text() (If I do the following, it will re-lauch the directory list), which I don't want. self.lineEdit.setText(self.fileDialog.getOpenFileName()) Thanks in advance. SM
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor