class CalculatorForm(QWidget): def __init__(self, parent=None): super(CalculatorForm, self).__init__(parent) self.ui = Ui_CalculatorForm() self.ui.setupUi(self) @pyqtSlot(int) def on_inputSpinBox1_valueChanged(self, value): self.ui.outputWidget.setText(str(value + self.ui.inputSpinBox2.value())) @pyqtSlot(int) def on_inputSpinBox2_valueChanged(self, value): self.ui.outputWidget.setText(str(value + self.ui.inputSpinBox1.value()))
class CalculatorForm(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_CalculatorForm() self.ui.setupUi(self) @QtCore.Slot(int) def on_inputSpinBox1_valueChanged(self, value): self.ui.outputWidget.setText(str(value + self.ui.inputSpinBox2.value())) @QtCore.Slot(int) def on_inputSpinBox2_valueChanged(self, value): self.ui.outputWidget.setText(str(value + self.ui.inputSpinBox1.value()))