def __init__(self,parent=None): global offset,override_value,is_overridden # self.offset = 0 # self.override_value = 0 # self.is_overridden = False QtGui.QWidget.__init__(self, parent) self.ui = Ui_Manual() self.ui.setupUi(self) QtCore.QObject.connect(self.ui.ds,QtCore.SIGNAL("clicked()"),self.buttonclick) QtCore.QObject.connect(self.ui.pushButton,QtCore.SIGNAL("clicked()"),self.startbuttonclick)
class form(QtGui.QMainWindow): def __init__(self,parent=None): global offset,override_value,is_overridden # self.offset = 0 # self.override_value = 0 # self.is_overridden = False QtGui.QWidget.__init__(self, parent) self.ui = Ui_Manual() self.ui.setupUi(self) QtCore.QObject.connect(self.ui.ds,QtCore.SIGNAL("clicked()"),self.buttonclick) QtCore.QObject.connect(self.ui.pushButton,QtCore.SIGNAL("clicked()"),self.startbuttonclick) def buttonclick(self): global offset,override_value,is_overridden,current_value override_value = self.ui.spinBox.value() offset = current_value - override_value is_overriden = True def startbuttonclick(self): global offset,override_value,is_overridden