[Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread Matthew Ngaha
Sorry for the forward, i forgot to reply to tutor On Mon, May 27, 2013 at 3:53 AM, Sunitha Misra sunith...@gmail.com wrote: self.fileDialog = QtGui.QFileDialog() QtCore.QObject.connect(self.toolButton, QtCore.SIGNAL(_fromUtf8(clicked())), self.fileDialog.getOpenFileName) i think the way

Re: [Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread SM
Thanks! I defined a function, as you suggested, to call when the button was clicked. But then I also had to use self.fileDialog from within the function. Not sure how I could avoid using fileDialog. I also defined global variable (under the class) and assigned it to the filename, so I could

Re: [Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread Matthew Ngaha
On Mon, May 27, 2013 at 2:14 PM, SM sunith...@gmail.com wrote: But then I also had to use self.fileDialog from within the function. Not sure how I could avoid using fileDialog. Thanks. No problem. to do it without the instance variable, you access its method directly. so replace: path =

Re: [Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread SM
Yes, the following works. path = QtGui.QFileDialog.getOpenFileName() Thanks! On Mon, May 27, 2013 at 9:45 AM, Matthew Ngaha chigga...@gmail.com wrote: On Mon, May 27, 2013 at 2:14 PM, SM sunith...@gmail.com wrote: But then I also had to use self.fileDialog from within the function. Not

Re: [Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread eryksun
On Mon, May 27, 2013 at 9:45 AM, Matthew Ngaha chigga...@gmail.com wrote: On Mon, May 27, 2013 at 2:14 PM, SM sunith...@gmail.com wrote: But then I also had to use self.fileDialog from within the function. Not sure how I could avoid using fileDialog. No problem. to do it without the instance

Re: [Tutor] Fwd: QT Python: How to re-use the return value of fileDialog.openFileName() ?

2013-05-27 Thread SM
Thank you, for the details. On Mon, May 27, 2013 at 10:13 AM, eryksun eryk...@gmail.com wrote: On Mon, May 27, 2013 at 9:45 AM, Matthew Ngaha chigga...@gmail.com wrote: On Mon, May 27, 2013 at 2:14 PM, SM sunith...@gmail.com wrote: But then I also had to use self.fileDialog from within