--- a/src/eric7/Project/IdlCompilerDefineNameDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Project/IdlCompilerDefineNameDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -19,10 +19,11 @@ Class implementing a dialog to enter the name-value pair to define a variable for the IDL compiler. """ + def __init__(self, name="", value="", parent=None): """ Constructor - + @param name name of the variable @type str @param value value of the variable @@ -32,36 +33,37 @@ """ super().__init__(parent) self.setupUi(self) - + self.nameEdit.setText(name) self.valueEdit.setText(value) - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + self.__updateOkButton() - + def __updateOkButton(self): """ Private slot to update the enable state of the OK button. """ self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( - bool(self.nameEdit.text())) - + bool(self.nameEdit.text()) + ) + @pyqtSlot(str) def on_nameEdit_textChanged(self, txt): """ Private slot to handle changes of the name. - + @param txt current text of the name edit @type str """ self.__updateOkButton() - + def getData(self): """ Public method to get the entered data. - + @return tuple containing the variable name and value @rtype tuple of (str, str) """