I have a GUI that has 4 widgets which are user inputs (file in/out and directory in/out). I am trying to make a button that will do two things.
I want to button when clicked to send the four user set parameters to another imported function.
self.btn.clicked.connect(lambda: self.sendData(self.rawName, self.outName, self.directoryIn, self.directoryOut))
I was using something like this. Where send data looks like this:
def sendData(self, rawName, outName, directoryIn, directoryOut):
try:
foo.main(rawName, outName, directoryIn, directoryOut)
except TypeError:
pass
In this case foo.main is the imported function. The user input method looks like this:
def setInputDirectory(self):
options = QtGui.QFileDialog.DontResolveSymlinks | QtGui.QFileDialog.ShowDirsOnly
directoryIn = QtGui.QFileDialog.getExistingDirectory(self,
"Some Directory",
self.directoryLabelIn.text(), options)
if directoryIn:
self.directoryLabelIn.setText(directoryIn)
Finally, I want to have the button (btn) be clickable only when all four values are entered in the gui.