pyside / pyqt: simple way to bind multiple buttons that shares the same functionality
问题 I'm new to PyQt / PySide. I have a lot of line edit (for displaying file location) and for each line text I have a push button (to display open file dialog). I have a method: def selectSelf1(self): """ browse for file dialog """ myDialog = QtGui.QFileDialog self.lineSelf1.setText(myDialog.getOpenFileName()) and a push button is binded using the following code self.btnSelf1.clicked.connect(self.selectSelf1) I have about 20 of those buttons and 20 of those line edits. Is there an easy way to