def initUi(self): with waitCursor(): loadUi(self, findResource('nicos_mlz/puma/gui/polarisation.ui')) valid = QDoubleValidator() for f in (self.kf, self.alpha0, self.eta, self.gamma1, self.gamma2, self.bA, self.dA, self.LSA, self.LSD1, self.LSD2, self.LPSD, self.LAD, self.R, self.L, self.d, self.bS, self.psdwidth, self.bD, self.theta05, self.theta06, self.theta07, self.x05, self.x06, self.x07, self.y05, self.y06, self.y07, self.ta5, self.ta6, self.ta7, self.rd5, self.rd6, self.rd7, self.rg5, self.rg6, self.rg7, self.PSDintUp, self.PSDintDown, self.IgesUp, self.IgesDown, self.fractionUp, self.fractionDown, self.I5Up, self.I5Down, self.I6Up, self.I6Down, self.I7Up, self.I7Down, self.ratioUp, self.ratioDown, self.Dplus, self.Dminus, self.x05_cur, self.x06_cur, self.x07_cur, self.ta5_cur, self.ta6_cur, self.ta7_cur, self.rd5_cur, self.rd6_cur, self.rd7_cur, self.rg5_cur, self.rg6_cur, self.rg7_cur, self.theta05_cur, self.theta06_cur, self.theta07_cur): f.setValidator(valid) f.setReadOnly(True) for b in (self.buttonRecall, self.buttonOK, self.buttonCancel, self.buttonOptimize, self.label_187, self.label_18, self.label_20, self.label_21, self.x05, self.x06, self.x07, self.x05_cur, self.x06_cur, self.x07_cur, self.progress): b.hide() self.plot1 = IntensityPlot('up', self.plotWidget1) self.plot2 = IntensityPlot('down', self.plotWidget2) self.plot3 = TransmissionPlot('up', self.plotWidget3) self.plot4 = TransmissionPlot('down', self.plotWidget4)
def initUi(self): loadUi(self, findResource('nicos_mlz/refsans/gui/resolutionpanel.ui')) valid = QDoubleValidator() for f in (self.chSpeed, self.phase2, self.phase3, self.phase4, self.phase5, self.phase6): f.setValidator(valid) f.setReadOnly(True)
def __init__(self, parent=None): QWidget.__init__(self, parent) self.setLayout(QHBoxLayout()) self.layout().setContentsMargins(0.1, 0.1, 0.1, 0.1) self.layout().setSpacing(1) self.val = QLineEdit() self.val.setValidator(QDoubleValidator(0, 1000000, 2)) self.layout().addWidget(self.val) self.unit = QComboBox() self.unit.insertItems(0, self.units) self.layout().addWidget(self.unit) self.setValue(1) self.val.returnPressed.connect(self.on_returnPressed) self.val.editingFinished.connect(self.on_returnPressed) self.unit.currentIndexChanged.connect(self.recalcValue)
def initUi(self): with waitCursor(): loadUi(self, findResource('nicos_mlz/toftof/gui/resolutionpanel.ui')) valid = QDoubleValidator() for f in (self.E_neutron, self.Q0_min, self.Q0_max, self.dE_max, self.dE_el): f.setValidator(valid) f.setReadOnly(True) self.plot1 = DynamicRangePlot(self.drPlot) self.plot2 = ElasticResolutionPlot(self.erPlot) self.plot3 = ResolutionPlot(self.rPlot)
def validate(self, string, pos): if ',' in string: return QValidator.Invalid, string, pos return QDoubleValidator.validate(self, string, pos)