def _build_linear_ui(self, layout: QtWidgets.QLayout) -> None: self.box_linear_start = self._make_spin_box() layout.addWidget(self.box_linear_start) layout.setStretchFactor(self.box_linear_start, 1) layout.addWidget(self._make_divider()) self.box_linear_points = QtWidgets.QSpinBox() self.box_linear_points.setMinimum(2) self.box_linear_points.setValue(21) # Somewhat gratuitously restrict the number of scan points for sizing, and to # avoid the user accidentally pasting in millions of points, etc. self.box_linear_points.setMaximum(0xffff) self.box_linear_points.setSuffix(" pts") layout.addWidget(self.box_linear_points) layout.setStretchFactor(self.box_linear_points, 0) self.box_linear_randomise = self._make_randomise_box() layout.addWidget(self.box_linear_randomise) layout.setStretchFactor(self.box_linear_randomise, 0) layout.addWidget(self._make_divider()) self.box_linear_stop = self._make_spin_box() layout.addWidget(self.box_linear_stop) layout.setStretchFactor(self.box_linear_stop, 1)
def _build_list_ui(self, layout: QtWidgets.QLayout) -> None: class Validator(QtGui.QValidator): def validate(self, input, pos): try: [float(f) for f in _parse_list_pyon(input)] return QtGui.QValidator.Acceptable, input, pos except Exception: return QtGui.QValidator.Intermediate, input, pos self.box_list_pyon = QtWidgets.QLineEdit() self.box_list_pyon.setValidator(Validator(self)) layout.addWidget(self.box_list_pyon) layout.addWidget(self._make_divider()) self.box_list_randomise = self._make_randomise_box() layout.addWidget(self.box_list_randomise) layout.setStretchFactor(self.box_list_randomise, 0)
def _build_refining_ui(self, layout: QtWidgets.QLayout) -> None: self.box_refining_lower = self._make_spin_box() layout.addWidget(self.box_refining_lower) layout.setStretchFactor(self.box_refining_lower, 1) layout.addWidget(self._make_divider()) self.box_refining_randomise = self._make_randomise_box() layout.addWidget(self.box_refining_randomise) layout.setStretchFactor(self.box_refining_randomise, 0) layout.addWidget(self._make_divider()) self.box_refining_upper = self._make_spin_box() layout.addWidget(self.box_refining_upper) layout.setStretchFactor(self.box_refining_upper, 1)
def _build_linear_ui(self, layout: QtWidgets.QLayout) -> None: self.box_linear_start = self._make_spin_box() layout.addWidget(self.box_linear_start) layout.setStretchFactor(self.box_linear_start, 1) layout.addWidget(self._make_divider()) self.box_linear_points = QtWidgets.QSpinBox() self.box_linear_points.setMinimum(2) self.box_linear_points.setMaximum( 2**16) # A gratuitous, but probably generous restriction self.box_linear_points.setSuffix(" pts") layout.addWidget(self.box_linear_points) layout.setStretchFactor(self.box_linear_points, 0) self.box_linear_randomise = self._make_randomise_box() layout.addWidget(self.box_linear_randomise) layout.setStretchFactor(self.box_linear_randomise, 0) layout.addWidget(self._make_divider()) self.box_linear_stop = self._make_spin_box() layout.addWidget(self.box_linear_stop) layout.setStretchFactor(self.box_linear_stop, 1)