class TermsFrame(ConfigBaseFrame): def __init__(self, parent=None): super(TermsFrame, self).__init__(parent) self.setObjectName("botnet_termsframe_start") self.disable_next_on_enter = True self.widget_layout = QVBoxLayout(self) self.setLayout(self.widget_layout) self.terms = QTextEdit(self) self.terms.setReadOnly(True) self.terms.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) self.terms.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.terms.setLineWrapMode(QTextEdit.WidgetWidth) self.terms.setWordWrapMode(QTextOption.WrapAnywhere) with open(os.path.join(sys.path[0], "../LICENSE")) as f: self.terms.setText(f.read()) self.widget_layout.addWidget(self.terms) self.accept = QCheckBox(self) self.accept.setChecked(False) self.accept.setText("Accept license") self.accept.setObjectName("license_checkbox") self.widget_layout.addWidget(self.accept) QMetaObject.connectSlotsByName(self) @Slot(bool) def on_license_checkbox_clicked(self, checked): self.set_next_enabled.emit(checked) self.disable_next_on_enter = not checked @Slot() def collect_info(self): return {"terms_accepted": self.accept.isChecked()}
def _setupFull(self): lay = QGridLayout(self) lay.addWidget(QLabel('Off', self, alignment=Qt.AlignCenter), 0, 1) lay.addWidget(QLabel('On', self, alignment=Qt.AlignCenter), 0, 2) lay.addWidget(QLabel('Status', self, alignment=Qt.AlignCenter), 0, 3) self._checkbox_off = dict() self._checkbox_on = dict() self._labels_sts = dict() for idx, name in enumerate(self._handler.DEF_ON_ORDER): cb_off = QCheckBox(self) cb_off.setObjectName(name) self._checkbox_off[name] = cb_off cb_on = QCheckBox(self) cb_on.setObjectName(name) self._checkbox_on[name] = cb_on desc = self._handler.HANDLER_DESC[name] splitd = desc.split('(') lbl_txt = splitd[0] tip = '' if len(splitd) > 1: lbl_txt, tip = splitd lb_dsc = QLabel(lbl_txt, self, alignment=Qt.AlignLeft) if tip: lb_dsc.setToolTip(tip[:-1]) lb_sts = QLabel('', self, alignment=Qt.AlignCenter) lb_sts.setObjectName(name) self._labels_sts[name] = lb_sts lay.addWidget(lb_dsc, idx + 1, 0) lay.addWidget(cb_off, idx + 1, 1, alignment=Qt.AlignCenter) lay.addWidget(cb_on, idx + 1, 2, alignment=Qt.AlignCenter) lay.addWidget(lb_sts, idx + 1, 3) self._pb_off = PyDMPushButton(self, label='', icon=self._icon_off, init_channel=self._inj_prefix.substitute( propty='InjSysTurnOff-Cmd'), pressValue=0) self._pb_off.setObjectName('bt') self._pb_off.setStyleSheet( '#bt{min-width:25px; max-width:25px; icon-size:20px;}') self._pb_on = PyDMPushButton(self, label='', icon=self._icon_on, init_channel=self._inj_prefix.substitute( propty='InjSysTurnOn-Cmd'), pressValue=0) self._pb_on.setObjectName('bt') self._pb_on.setStyleSheet( '#bt{min-width:25px; max-width:25px; icon-size:20px;}') self._led_sts = InjSysStbyLed(self) lay.addWidget(self._pb_off, 6, 1) lay.addWidget(self._pb_on, 6, 2) lay.addWidget(self._led_sts, 6, 3)
def __init__(self, layer): super().__init__() self.layer = layer self.layer.events.select.connect(self._on_select_change) self.layer.events.deselect.connect(self._on_deselect_change) self.layer.events.name.connect(self._on_name_change) self.layer.events.visible.connect(self._on_visible_change) self.layer.events.thumbnail.connect(self._on_thumbnail_change) self.setAttribute(Qt.WA_DeleteOnClose) self.setObjectName('layer') self.layout = QHBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self.layout) tb = QLabel(self) tb.setObjectName('thumbnail') tb.setToolTip(trans._('Layer thumbnail')) self.thumbnailLabel = tb self._on_thumbnail_change() self.layout.addWidget(tb) cb = QCheckBox(self) cb.setObjectName('visibility') cb.setToolTip(trans._('Layer visibility')) cb.setChecked(self.layer.visible) cb.setProperty('mode', 'visibility') cb.stateChanged.connect(self.changeVisible) self.visibleCheckBox = cb self.layout.addWidget(cb) textbox = QLineEdit(self) textbox.setText(layer.name) textbox.home(False) textbox.setToolTip(self.layer.name) textbox.setAcceptDrops(False) textbox.setEnabled(True) textbox.editingFinished.connect(self.changeText) self.nameTextBox = textbox self.layout.addWidget(textbox) ltb = QLabel(self) layer_type = type(layer).__name__ ltb.setObjectName(layer_type) ltb.setProperty('layer_type_label', True) ltb.setToolTip(trans._('Layer type')) self.typeLabel = ltb self.layout.addWidget(ltb) msg = trans._('Click to select\nDrag to rearrange') self.setToolTip(msg) self.setSelected(self.layer.selected)
def __init__(self, dims, axis, reverse=False, fps=10, mode=LoopMode.LOOP): super().__init__() self.dims = dims self.axis = axis self.reverse = reverse self.fps = fps self.mode = mode self.setProperty('reverse', str(reverse)) # for styling self.setProperty('playing', 'False') # for styling # build popup modal form self.popup = QtPopup(self) form_layout = QFormLayout() self.popup.frame.setLayout(form_layout) fpsspin = QtCustomDoubleSpinBox(self.popup) fpsspin.setObjectName("fpsSpinBox") fpsspin.setAlignment(Qt.AlignCenter) fpsspin.setValue(self.fps) if hasattr(fpsspin, 'setStepType'): # this was introduced in Qt 5.12. Totally optional, just nice. fpsspin.setStepType(QDoubleSpinBox.AdaptiveDecimalStepType) fpsspin.setMaximum(500) fpsspin.setMinimum(0) form_layout.insertRow( 0, QLabel(trans._('frames per second:'), parent=self.popup), fpsspin, ) self.fpsspin = fpsspin revcheck = QCheckBox(self.popup) revcheck.setObjectName("playDirectionCheckBox") form_layout.insertRow( 1, QLabel(trans._('play direction:'), parent=self.popup), revcheck ) self.reverse_check = revcheck mode_combo = QComboBox(self.popup) mode_combo.addItems([str(i).replace('_', ' ') for i in LoopMode]) form_layout.insertRow( 2, QLabel(trans._('play mode:'), parent=self.popup), mode_combo ) mode_combo.setCurrentText(str(self.mode)) self.mode_combo = mode_combo
def make_tag_filters(self): if not self.tags: self.tags = set() for content_item in self.content_info: tags = content_item.get('tags', []) for tag in tags: if tag: self.tags.add(tag) logger.debug("TAGS: %s", self.tags) self.filter_widgets = [] for tag in self.tags: item = QCheckBox(tag.capitalize()) item.setObjectName(tag.lower()) item.setChecked(True) item.clicked.connect(self.filter_content) self.filter_widgets.append(item) self.filters_layout.addWidget(item)
def __init__(self, layer): super().__init__() self.layer = layer layer.events.select.connect(lambda v: self.setSelected(True)) layer.events.deselect.connect(lambda v: self.setSelected(False)) layer.events.name.connect(self._on_layer_name_change) layer.events.blending.connect(self._on_blending_change) layer.events.opacity.connect(self._on_opacity_change) layer.events.visible.connect(self._on_visible_change) layer.events.thumbnail.connect(self._on_thumbnail_change) self.setObjectName('layer') self.vbox_layout = QVBoxLayout() self.top = QFrame() self.top_layout = QHBoxLayout() self.grid = QFrame() self.grid_layout = QGridLayout() self.vbox_layout.addWidget(self.top) self.vbox_layout.addWidget(self.grid) self.vbox_layout.setSpacing(0) self.top.setFixedHeight(38) self.top_layout.setContentsMargins(0, 0, 0, 0) self.grid_layout.setContentsMargins(0, 0, 0, 0) self.top_layout.setAlignment(Qt.AlignCenter) self.top.setLayout(self.top_layout) self.grid.setLayout(self.grid_layout) self.setLayout(self.vbox_layout) self.name_column = 0 self.property_column = 1 cb = QCheckBox(self) cb.setObjectName('visibility') cb.setToolTip('Layer visibility') cb.setChecked(self.layer.visible) cb.setProperty('mode', 'visibility') cb.stateChanged.connect(lambda state=cb: self.changeVisible(state)) self.visibleCheckBox = cb self.top_layout.addWidget(cb) tb = QLabel(self) tb.setObjectName('thumbmnail') tb.setToolTip('Layer thumbmnail') self.thumbnail_label = tb self._on_thumbnail_change(None) self.top_layout.addWidget(tb) textbox = QLineEdit(self) textbox.setText(layer.name) textbox.home(False) textbox.setToolTip('Layer name') textbox.setAcceptDrops(False) textbox.setEnabled(True) textbox.editingFinished.connect(self.changeText) self.nameTextBox = textbox self.top_layout.addWidget(textbox) pb = QPushButton(self) pb.setToolTip('Expand properties') pb.clicked.connect(self.changeExpanded) pb.setObjectName('expand') self.expand_button = pb self.top_layout.addWidget(pb) row = self.grid_layout.rowCount() sld = QSlider(Qt.Horizontal, self) sld.setFocusPolicy(Qt.NoFocus) sld.setMinimum(0) sld.setMaximum(100) sld.setSingleStep(1) sld.setValue(self.layer.opacity * 100) sld.valueChanged[int].connect( lambda value=sld: self.changeOpacity(value)) self.opacitySilder = sld row = self.grid_layout.rowCount() self.grid_layout.addWidget(QLabel('opacity:'), row, self.name_column) self.grid_layout.addWidget(sld, row, self.property_column) row = self.grid_layout.rowCount() blend_comboBox = QComboBox() for blend in Blending: blend_comboBox.addItem(str(blend)) index = blend_comboBox.findText(self.layer.blending, Qt.MatchFixedString) blend_comboBox.setCurrentIndex(index) blend_comboBox.activated[str].connect( lambda text=blend_comboBox: self.changeBlending(text)) self.blendComboBox = blend_comboBox self.grid_layout.addWidget(QLabel('blending:'), row, self.name_column) self.grid_layout.addWidget(blend_comboBox, row, self.property_column) msg = 'Click to select\nDrag to rearrange\nDouble click to expand' self.setToolTip(msg) self.setExpanded(False) self.setFixedWidth(250) self.grid_layout.setColumnMinimumWidth(0, 100) self.grid_layout.setColumnMinimumWidth(1, 100) self.setSelected(self.layer.selected)
def generate_pv_controls(self, pv_name, curve_color): """ Generate a set of widgets to manage the appearance of a curve. The set of widgets includes: 1. A checkbox which shows the curve on the chart if checked, and hide the curve if not checked 2. Two buttons -- Modify... and Remove. Modify... will bring up the Curve Settings dialog. Remove will delete the curve from the chart This set of widgets will be hidden initially, until the first curve is plotted. Parameters ---------- pv_name: str The name of the PV the current curve is being plotted for curve_color : QColor The color of the curve to paint for the checkbox label to help the user track the curve to the checkbox """ checkbox = QCheckBox() checkbox.setObjectName(pv_name) palette = checkbox.palette() palette.setColor(QPalette.Active, QPalette.WindowText, curve_color) checkbox.setPalette(palette) display_name = pv_name.split("://")[1] if len(display_name) > MAX_DISPLAY_PV_NAME_LENGTH: # Only display max allowed number of characters of the PV Name display_name = display_name[:int(MAX_DISPLAY_PV_NAME_LENGTH / 2) - 1] + "..." + \ display_name[-int(MAX_DISPLAY_PV_NAME_LENGTH / 2) + 2:] checkbox.setText(display_name) data_text = QLabel() data_text.setObjectName(pv_name) data_text.setPalette(palette) checkbox.setChecked(True) checkbox.clicked.connect( partial(self.handle_curve_chkbox_toggled, checkbox)) curve_btn_layout = QHBoxLayout() modify_curve_btn = QPushButton("Modify...") modify_curve_btn.setObjectName(pv_name) modify_curve_btn.setMaximumWidth(100) modify_curve_btn.clicked.connect( partial(self.display_curve_settings_dialog, pv_name)) focus_curve_btn = QPushButton("Focus") focus_curve_btn.setObjectName(pv_name) focus_curve_btn.setMaximumWidth(100) focus_curve_btn.clicked.connect(partial(self.focus_curve, pv_name)) annotate_curve_btn = QPushButton("Annotate...") annotate_curve_btn.setObjectName(pv_name) annotate_curve_btn.setMaximumWidth(100) annotate_curve_btn.clicked.connect( partial(self.annotate_curve, pv_name)) remove_curve_btn = QPushButton("Remove") remove_curve_btn.setObjectName(pv_name) remove_curve_btn.setMaximumWidth(100) remove_curve_btn.clicked.connect(partial(self.remove_curve, pv_name)) curve_btn_layout.addWidget(modify_curve_btn) curve_btn_layout.addWidget(focus_curve_btn) curve_btn_layout.addWidget(annotate_curve_btn) curve_btn_layout.addWidget(remove_curve_btn) individual_curve_layout = QVBoxLayout() individual_curve_layout.addWidget(checkbox) individual_curve_layout.addWidget(data_text) individual_curve_layout.addLayout(curve_btn_layout) size_policy = QSizePolicy() size_policy.setVerticalPolicy(QSizePolicy.Fixed) individual_curve_grpbx = QGroupBox() individual_curve_grpbx.setSizePolicy(size_policy) individual_curve_grpbx.setObjectName(pv_name) individual_curve_grpbx.setLayout(individual_curve_layout) self.curve_settings_layout.addWidget(individual_curve_grpbx) self.tab_panel.show()
def uicreate_groupbox(self, idx): """.""" grpbx = QGroupBox(self.line_names[idx], self) grpbx.setCheckable(True) grpbx.setChecked(not idx) grpbx.toggled.connect(self.updater[idx].set_visible) vbl = QVBoxLayout(grpbx) gdl = QGridLayout() gdl.setSpacing(4) vbl.addLayout(gdl) if self.is_orb: lbl_orb = self.uicreate_label('Show', grpbx) lbl_ref = self.uicreate_label('as diff to:', grpbx) cbx_ref = self.uicreate_combobox(grpbx, 'ref', idx) cbx_orb = self.uicreate_combobox(grpbx, 'val', idx) gdl.addWidget(lbl_orb, 0, 0) gdl.addWidget(lbl_ref, 1, 0) gdl.addWidget(cbx_orb, 0, 1) gdl.addWidget(cbx_ref, 1, 1) pb_save = QPushButton('', grpbx) pb_save.clicked.connect(_part(self._save_difference, idx)) pb_save.setObjectName('butt') pb_save.setStyleSheet('#butt {max-width: 40px; icon-size: 35px;}') pb_save.setIcon(qta.icon('fa5.save')) pb_save.setToolTip('Save diff to file') gdl.addWidget(pb_save, 0, 2, 2, 1) unit = 'm' if self.is_orb else 'rad' for pln in ('x', 'y'): wid = QWidget(grpbx) vbl.addWidget(wid) vbl.setSpacing(2) hbl = QHBoxLayout(wid) hbl.setSpacing(0) cbx = QCheckBox('{0:s}:'.format(pln.upper()), wid) cbx.setObjectName(pln + 'checkbox') cbx.setChecked(False) hbl.addWidget(cbx) lab_avg = Label(unit, '-100.00 mrad', wid) self.updater[idx].ave[pln].connect(lab_avg.setFloat) lab_avg.setStyleSheet("""min-width:4.5em;""") lab_avg.setAlignment(Qt.AlignRight) hbl.addWidget(lab_avg) hbl.addWidget( QLabel(" <html><head/><body><p>±</p></body></html> ", wid)) lab_std = Label(unit, '100.00 mrad', wid) self.updater[idx].std[pln].connect(lab_std.setFloat) lab_std.setStyleSheet("""min-width:4.5em;""") lab_std.setAlignment(Qt.AlignLeft) hbl.addWidget(lab_std) hbl.addWidget(QLabel('(pp. ', wid)) lab_p2p = Label(unit, '100.00 mrad', wid) self.updater[idx].p2p[pln].connect(lab_p2p.setFloat) lab_p2p.setStyleSheet("""min-width:4.5em;""") lab_p2p.setAlignment(Qt.AlignLeft) hbl.addWidget(lab_p2p) hbl.addWidget(QLabel(')', wid)) return grpbx
def __init__(self, layer): super().__init__() self.layer = layer layer.events.select.connect(self._on_select) layer.events.deselect.connect(self._on_deselect) layer.events.name.connect(self._on_layer_name_change) layer.events.blending.connect(self._on_blending_change) layer.events.opacity.connect(self._on_opacity_change) layer.events.visible.connect(self._on_visible_change) self.setObjectName('layer') self.grid_layout = QGridLayout() cb = QCheckBox(self) cb.setObjectName('visibility') cb.setToolTip('Layer visibility') cb.setChecked(self.layer.visible) cb.setProperty('mode', 'visibility') cb.stateChanged.connect(lambda state=cb: self.changeVisible(state)) self.visibleCheckBox = cb self.grid_layout.addWidget(cb, 0, 0) textbox = QLineEdit(self) textbox.setText(layer.name) textbox.home(False) textbox.setToolTip('Layer name') textbox.setFixedWidth(122) textbox.setAcceptDrops(False) textbox.setEnabled(True) textbox.editingFinished.connect(self.changeText) self.nameTextBox = textbox self.grid_layout.addWidget(textbox, 0, 1) self.grid_layout.addWidget(QLabel('opacity:'), 1, 0) sld = QSlider(Qt.Horizontal, self) sld.setFocusPolicy(Qt.NoFocus) sld.setFixedWidth(110) sld.setMinimum(0) sld.setMaximum(100) sld.setSingleStep(1) sld.setValue(self.layer.opacity * 100) sld.valueChanged[int].connect( lambda value=sld: self.changeOpacity(value)) self.opacitySilder = sld self.grid_layout.addWidget(sld, 1, 1) blend_comboBox = QComboBox() for blend in self.layer._blending_modes: blend_comboBox.addItem(blend) index = blend_comboBox.findText(self.layer.blending, Qt.MatchFixedString) blend_comboBox.setCurrentIndex(index) blend_comboBox.activated[str].connect( lambda text=blend_comboBox: self.changeBlending(text)) self.blendComboBox = blend_comboBox self.grid_layout.addWidget(QLabel('blending:'), 2, 0) self.grid_layout.addWidget(blend_comboBox, 2, 1) self.setLayout(self.grid_layout) msg = 'Click to select\nDrag to rearrange\nDouble click to expand' self.setToolTip(msg) self.setExpanded(False) self.setFixedWidth(250) self.grid_layout.setColumnMinimumWidth(0, 100) self.grid_layout.setColumnMinimumWidth(1, 100) self.layer.selected = True
def generate_pv_controls(self, pv_name, curve_color): """ Generate a set of widgets to manage the appearance of a curve. The set of widgets includes: 1. A checkbox which shows the curve on the chart if checked, and hide the curve if not checked 2. Three buttons -- Modify..., Focus, and Remove. Modify... will bring up the Curve Settings dialog. Focus adjusts the chart's zooming for the current curve. Remove will delete the curve from the chart Parameters ---------- pv_name: str The name of the PV the current curve is being plotted for curve_color : QColor The color of the curve to paint for the checkbox label to help the user track the curve to the checkbox """ individual_curve_layout = QVBoxLayout() size_policy = QSizePolicy() size_policy.setVerticalPolicy(QSizePolicy.Fixed) size_policy.setHorizontalPolicy(QSizePolicy.Fixed) individual_curve_grpbx = QGroupBox() individual_curve_grpbx.setMinimumWidth(300) individual_curve_grpbx.setMinimumHeight(120) individual_curve_grpbx.setAlignment(Qt.AlignTop) individual_curve_grpbx.setSizePolicy(size_policy) individual_curve_grpbx.setObjectName(pv_name + "_grb") individual_curve_grpbx.setLayout(individual_curve_layout) checkbox = QCheckBox(parent=individual_curve_grpbx) checkbox.setObjectName(pv_name + "_chb") palette = checkbox.palette() palette.setColor(QPalette.Active, QPalette.WindowText, curve_color) checkbox.setPalette(palette) display_name = pv_name.split("://")[1] if len(display_name) > MAX_DISPLAY_PV_NAME_LENGTH: # Only display max allowed number of characters of the PV Name display_name = display_name[ :int(MAX_DISPLAY_PV_NAME_LENGTH / 2) - 1] + "..." + \ display_name[ -int(MAX_DISPLAY_PV_NAME_LENGTH / 2) + 2:] checkbox.setText(display_name) data_text = QLabel(parent=individual_curve_grpbx) data_text.setWordWrap(True) data_text.setObjectName(pv_name + "_lbl") data_text.setPalette(palette) checkbox.setChecked(True) checkbox.toggled.connect( partial(self.handle_curve_chkbox_toggled, checkbox)) if not self.chart.findCurve(pv_name).isVisible(): checkbox.setChecked(False) modify_curve_btn = QPushButton("Modify...", parent=individual_curve_grpbx) modify_curve_btn.setObjectName(pv_name + "_btn_modify") modify_curve_btn.setMaximumWidth(80) modify_curve_btn.clicked.connect( partial(self.display_curve_settings_dialog, pv_name)) focus_curve_btn = QPushButton("Focus", parent=individual_curve_grpbx) focus_curve_btn.setObjectName(pv_name + "_btn_focus") focus_curve_btn.setMaximumWidth(80) focus_curve_btn.clicked.connect(partial(self.focus_curve, pv_name)) clear_curve_btn = QPushButton("Clear", parent=individual_curve_grpbx) clear_curve_btn.setObjectName(pv_name + "_btn_clear") clear_curve_btn.setMaximumWidth(80) clear_curve_btn.clicked.connect(partial(self.clear_curve, pv_name)) # annotate_curve_btn = QPushButton("Annotate...", # parent=individual_curve_grpbx) # annotate_curve_btn.setObjectName(pv_name+"_btn_ann") # annotate_curve_btn.setMaximumWidth(80) # annotate_curve_btn.clicked.connect( # partial(self.annotate_curve, pv_name)) remove_curve_btn = QPushButton("Remove", parent=individual_curve_grpbx) remove_curve_btn.setObjectName(pv_name + "_btn_remove") remove_curve_btn.setMaximumWidth(80) remove_curve_btn.clicked.connect(partial(self.remove_curve, pv_name)) curve_btn_layout = QHBoxLayout() curve_btn_layout.setSpacing(5) curve_btn_layout.addWidget(modify_curve_btn) curve_btn_layout.addWidget(focus_curve_btn) curve_btn_layout.addWidget(clear_curve_btn) # curve_btn_layout.addWidget(annotate_curve_btn) curve_btn_layout.addWidget(remove_curve_btn) individual_curve_layout.addWidget(checkbox) individual_curve_layout.addWidget(data_text) individual_curve_layout.addLayout(curve_btn_layout) self.curve_settings_layout.addWidget(individual_curve_grpbx) self.tab_panel.setCurrentIndex(0)
def _setupUi(self): self.quads = QWidget(self) vlay_quad = QVBoxLayout() vlay_quad.setAlignment(Qt.AlignTop) self.quads.setLayout(vlay_quad) self.sexts = QWidget(self) vlay_sext = QVBoxLayout() vlay_sext.setAlignment(Qt.AlignTop) self.sexts.setLayout(vlay_sext) self.chs = QWidget(self) vlay_ch = QVBoxLayout() vlay_ch.setAlignment(Qt.AlignTop) self.chs.setLayout(vlay_ch) self.cvs = QWidget(self) vlay_cv = QVBoxLayout() vlay_cv.setAlignment(Qt.AlignTop) self.cvs.setLayout(vlay_cv) self.all_quad_sel = QCheckBox('All quadrupoles', self.quads) self.all_quad_sel.clicked.connect(self._handleSelectGroups) vlay_quad.addWidget(self.all_quad_sel) self.all_sext_sel = QCheckBox('All sextupoles', self.sexts) self.all_sext_sel.clicked.connect(self._handleSelectGroups) vlay_sext.addWidget(self.all_sext_sel) self.all_ch_sel = QCheckBox('All CHs', self.chs) self.all_ch_sel.clicked.connect(self._handleSelectGroups) vlay_ch.addWidget(self.all_ch_sel) self.all_cv_sel = QCheckBox('All CVs', self.cvs) self.all_cv_sel.clicked.connect(self._handleSelectGroups) vlay_cv.addWidget(self.all_cv_sel) for psname in self.psnames: if psname.dev in {'QF', 'QD', 'QS'}: cb_psname = QCheckBox(psname, self.quads) vlay_quad.addWidget(cb_psname) elif psname.dev in {'SF', 'SD'}: cb_psname = QCheckBox(psname, self.sexts) vlay_sext.addWidget(cb_psname) elif psname.dev == 'CH': cb_psname = QCheckBox(psname, self.chs) vlay_ch.addWidget(cb_psname) elif psname.dev == 'CV': cb_psname = QCheckBox(psname, self.cvs) vlay_cv.addWidget(cb_psname) if psname in self.current_plots: cb_psname.setChecked(True) cb_psname.setObjectName(psname) self.pb_choose = QPushButton('Choose', self) self.pb_choose.clicked.connect(self._emitChoosePlot) glay = QGridLayout() glay.addWidget(self.quads, 0, 0) glay.addWidget(self.sexts, 1, 0) glay.addWidget(self.chs, 0, 1, 2, 1) glay.addWidget(self.cvs, 0, 2, 2, 1) glay.addWidget(self.pb_choose, 2, 1) self.setLayout(glay)