class StringWidget(QValueWidget): def __init__(self,parent,label,default): QValueWidget.__init__(self,parent) self.ui = Ui_ValueWidget() self.ui.setupUi(self) self.ui.label.setText(label) self.ui.valueEdit.setText(default) def getValue(self): return self.ui.valueEdit.text()
class StringWidget(QValueWidget): def __init__(self, parent, label, default): QValueWidget.__init__(self, parent) self.ui = Ui_ValueWidget() self.ui.setupUi(self) self.ui.label.setText(label) self.ui.valueEdit.setText(default) def getValue(self): return self.ui.valueEdit.text()
class NumberWidget(QValueWidget): def __init__(self,parent,label,default): QValueWidget.__init__(self,parent) self.ui = Ui_ValueWidget() self.ui.setupUi(self) self.ui.label.setText(label) self.ui.valueEdit.setText(default) self.validator = QtGui.QDoubleValidator(self) self.ui.valueEdit.setValidator(self.validator) def getValue(self): return float(self.ui.valueEdit.text())
class NumberWidget(QValueWidget): def __init__(self, parent, label, default): QValueWidget.__init__(self, parent) self.ui = Ui_ValueWidget() self.ui.setupUi(self) self.ui.label.setText(label) self.ui.valueEdit.setText(default) self.validator = QtGui.QDoubleValidator(self) self.ui.valueEdit.setValidator(self.validator) def getValue(self): return float(self.ui.valueEdit.text())