I am having browse button in the UI on clicking that should trigger opening filedialog. My issue is opening the filedialog is triggering even before the browse button is clicked. Below is my code
class GisedifySupportDialog(QtWidgets.QDialog, FORM_CLASS):
def __init__(self, parent=None):
"""Constructor."""
super(GisedifySupportDialog, self).__init__(parent)
self.setupUi(self)
self.img_upload=Upload_Image()
self.img_upload.setupUi(self.upload_image_dialog)
self.img_upload.pushButton.clicked.connect(self.browseTheFileAudio(self.img_upload.lineEdit))
def browseTheFileAudio(self,lineedit_name):
self.fileName = QtWidgets.QFileDialog.getOpenFileName(self, "Browse for the file", os.getenv("HOME"))
self.fileName=self.fileName
lineedit_name.setText(str(self.fileName))
return self.fileName
Any reason why the briwseTheFileAudio function is trigerring even before the pushbutton is clicked?