def setup_page(self): # Connections group connections_group = QGroupBox(_("Automatic connections")) connections_label = QLabel(_("This pane can automatically " "show an object's help information after " "a left parenthesis is written next to it. " "Below you can decide to which plugin " "you want to connect it to turn on this " "feature.")) connections_label.setWordWrap(True) editor_box = self.create_checkbox(_("Editor"), 'connect/editor') rope_installed = programs.is_module_installed('rope') jedi_installed = programs.is_module_installed('jedi', '>=0.8.1') editor_box.setEnabled(rope_installed or jedi_installed) if not rope_installed and not jedi_installed: editor_tip = _("This feature requires the Rope or Jedi libraries.\n" "It seems you don't have either installed.") editor_box.setToolTip(editor_tip) ipython_box = self.create_checkbox(_("IPython Console"), 'connect/ipython_console') connections_layout = QVBoxLayout() connections_layout.addWidget(connections_label) connections_layout.addWidget(editor_box) connections_layout.addWidget(ipython_box) connections_group.setLayout(connections_layout) # Features group features_group = QGroupBox(_("Additional features")) math_box = self.create_checkbox(_("Render mathematical equations"), 'math') req_sphinx = programs.is_module_installed('sphinx', '>=1.1') math_box.setEnabled(req_sphinx) if not req_sphinx: sphinx_ver = programs.get_module_version('sphinx') sphinx_tip = _("This feature requires Sphinx 1.1 or superior.") sphinx_tip += "\n" + _("Sphinx %s is currently installed.") % sphinx_ver math_box.setToolTip(sphinx_tip) features_layout = QVBoxLayout() features_layout.addWidget(math_box) features_group.setLayout(features_layout) # Source code group sourcecode_group = QGroupBox(_("Source code")) wrap_mode_box = self.create_checkbox(_("Wrap lines"), 'wrap') sourcecode_layout = QVBoxLayout() sourcecode_layout.addWidget(wrap_mode_box) sourcecode_group.setLayout(sourcecode_layout) # Final layout vlayout = QVBoxLayout() vlayout.addWidget(connections_group) vlayout.addWidget(features_group) vlayout.addWidget(sourcecode_group) vlayout.addStretch(1) self.setLayout(vlayout)
def __init__(self, plugin): plugin.layout_vertical = QVBoxLayout() plugin.layout_vertical.setContentsMargins(11, 11, 11, 11) plugin.layout_vertical.setSpacing(6) plugin.group_box = QGroupBox() plugin.contents.setLayout(plugin.layout_vertical) plugin.layout_vertical.setContentsMargins(11, 11, 11, 11) plugin.group_box_layout = QVBoxLayout(plugin.group_box) plugin.group_box_layout.setContentsMargins(10, 0, 0, 0) plugin.group_box_layout.setSpacing(0) plugin.checkbox_horizontal_layout = QHBoxLayout() plugin.checkbox_horizontal_layout.setContentsMargins(10, 0, 0, 0) plugin.checkbox_horizontal_layout.setSpacing(0) plugin.checkbox_show_mask = QCheckBox("Show Masked Data") plugin.checkbox_show_mask.setChecked(False) plugin.checkbox_horizontal_layout.addWidget(plugin.checkbox_show_mask) plugin.group_box_layout.addLayout(plugin.checkbox_horizontal_layout) plugin.layout_horizontal_mask_button = QHBoxLayout() plugin.layout_horizontal_mask_button.setContentsMargins(0, 0, 0, 0) plugin.layout_horizontal_mask_button.setSpacing(6) plugin.button_mask_data = QPushButton() plugin.button_mask_data.setText("Mask Data") plugin.button_mask_data.setToolTip("Mask data in current ROI") plugin.button_mask_data.setEnabled(False) plugin.button_unmask_data = QPushButton() plugin.button_unmask_data.setText("Unmask Data") plugin.button_unmask_data.setToolTip( "Remove mask from data in current ROI") plugin.button_unmask_data.setEnabled(False) plugin.layout_horizontal_mask_button.addWidget(plugin.button_mask_data) plugin.layout_horizontal_mask_button.addWidget( plugin.button_unmask_data) plugin.group_box_layout.addLayout(plugin.layout_horizontal_mask_button) # plugin.layout_vertical.setContentsMargins(11, 11, 11, 11) # plugin.setMaximumHeight(120) plugin.group_box_dq = QGroupBox("Data Quality Flags") plugin.group_box_dq_layout = QVBoxLayout(plugin.group_box_dq) plugin.group_box_dq_layout.setContentsMargins(10, 10, 10, 10) plugin.tree_widget_dq = QTreeWidget() plugin.tree_widget_dq.setColumnCount(3) plugin.tree_widget_dq.headerItem().setText(0, "Bit") plugin.tree_widget_dq.headerItem().setText(1, "Name") plugin.tree_widget_dq.headerItem().setText(2, "Description") plugin.group_box_dq_layout.addWidget(plugin.tree_widget_dq) plugin.layout_vertical.addWidget(plugin.group_box) plugin.layout_vertical.addWidget(plugin.group_box_dq)
def setup_page(self): ar_group = QGroupBox(_("Autorefresh")) ar_box = self.create_checkbox(_("Enable autorefresh"), 'autorefresh') ar_spin = self.create_spinbox(_("Refresh interval: "), _(" ms"), 'autorefresh/timeout', min_=100, max_=1000000, step=100) filter_group = QGroupBox(_("Filter")) filter_data = [ ('exclude_private', _("Exclude private references")), ('exclude_capitalized', _("Exclude capitalized references")), ('exclude_uppercase', _("Exclude all-uppercase references")), ('exclude_unsupported', _("Exclude unsupported data types")), ] filter_boxes = [ self.create_checkbox(text, option) for option, text in filter_data ] display_group = QGroupBox(_("Display")) display_data = [('truncate', _("Truncate values"), '')] if programs.is_module_installed('numpy'): display_data.append(('minmax', _("Show arrays min/max"), '')) display_data.append( ('remote_editing', _("Edit data in the remote process"), _("Editors are opened in the remote process for NumPy " "arrays, PIL images, lists, tuples and dictionaries.\n" "This avoids transfering large amount of data between " "the remote process and Spyder (through the socket)."))) display_boxes = [ self.create_checkbox(text, option, tip=tip) for option, text, tip in display_data ] ar_layout = QVBoxLayout() ar_layout.addWidget(ar_box) ar_layout.addWidget(ar_spin) ar_group.setLayout(ar_layout) filter_layout = QVBoxLayout() for box in filter_boxes: filter_layout.addWidget(box) filter_group.setLayout(filter_layout) display_layout = QVBoxLayout() for box in display_boxes: display_layout.addWidget(box) display_group.setLayout(display_layout) vlayout = QVBoxLayout() vlayout.addWidget(ar_group) vlayout.addWidget(filter_group) vlayout.addWidget(display_group) vlayout.addStretch(1) self.setLayout(vlayout)
def _create_operations_display(self): self.operationsGroupBox = QGroupBox("Operations layout") results_layout = QVBoxLayout() group_box = QGroupBox("Operation") results_layout.addWidget(group_box) group_box = QGroupBox("Results") results_layout.addWidget(group_box) self.operationsGroupBox.setLayout(results_layout)
def __init__(self, queue, graphmgr_addr, ami_save, parent=None): super(__class__, self).__init__(parent) self.setWindowTitle("AMI Client") self.comm_handler = AsyncGraphCommHandler(graphmgr_addr.name, graphmgr_addr.comm) self.save_button = QPushButton('Save', self) self.save_button.clicked.connect(self.save) self.load_button = QPushButton('Load', self) self.load_button.clicked.connect(self.load) self.clear_button = QPushButton('Clear', self) self.clear_button.clicked.connect(self.clear) self.reset_button = QPushButton('Reset Plots', self) self.reset_button.clicked.connect(self.reset) self.status_box = QPlainTextEdit(self) self.status_box.setReadOnly(True) self.amilist = DetectorList(queue, self.comm_handler) if ami_save is not None: self.comm_handler.update(ami_save) self.setup = QGroupBox("Setup") self.setup_layout = QHBoxLayout(self.setup) self.setup_layout.addWidget(self.save_button) self.setup_layout.addWidget(self.load_button) self.setup_layout.addWidget(self.clear_button) self.setup.setLayout(self.setup_layout) self.data = QGroupBox("Data") self.data_layout = QVBoxLayout(self) self.data_layout.addWidget(self.reset_button) self.data_layout.addWidget(self.amilist) self.data.setLayout(self.data_layout) self.status = QGroupBox("Status") self.status_layout = QVBoxLayout(self) self.status_layout.addWidget(self.status_box) self.status.setLayout(self.status_layout) self.ami_layout = QVBoxLayout(self) self.ami_layout.addWidget(self.setup, 1) self.ami_layout.addWidget(self.data, 4) self.ami_layout.addWidget(self.status, 2) self.loadFile.connect(self.load_async) self.saveFile.connect(self.save_async) self.statusUpdate.connect(self.status_box.appendPlainText) # the status box to logging add_logging_handler(self.statusUpdate) # create a qthread that listens for info messages from the cluster to log them. self.info_thread = AmiInfo(graphmgr_addr.info, self.log_message) self.info_thread.start()
def setup_page(self): settings_group = QGroupBox(_("Settings")) save_box = self.create_checkbox(_("Save file before analyzing it"), 'save_before', default=True) hist_group = QGroupBox(_("History")) hist_label1 = QLabel( _("The following option will be applied at next " "startup.")) hist_label1.setWordWrap(True) hist_spin = self.create_spinbox(_("History: "), _(" results"), 'max_entries', default=50, min_=10, max_=1000000, step=10) results_group = QGroupBox(_("Results")) results_label1 = QLabel(_("Results are stored here:")) results_label1.setWordWrap(True) # Warning: do not try to regroup the following QLabel contents with # widgets above -- this string was isolated here in a single QLabel # on purpose: to fix Issue 863 results_label2 = QLabel(PylintWidget.DATAPATH) results_label2.setTextInteractionFlags(Qt.TextSelectableByMouse) results_label2.setWordWrap(True) settings_layout = QVBoxLayout() settings_layout.addWidget(save_box) settings_group.setLayout(settings_layout) hist_layout = QVBoxLayout() hist_layout.addWidget(hist_label1) hist_layout.addWidget(hist_spin) hist_group.setLayout(hist_layout) results_layout = QVBoxLayout() results_layout.addWidget(results_label1) results_layout.addWidget(results_label2) results_group.setLayout(results_layout) vlayout = QVBoxLayout() vlayout.addWidget(settings_group) vlayout.addWidget(hist_group) vlayout.addWidget(results_group) vlayout.addStretch(1) self.setLayout(vlayout)
def __init__(self, parent): super().__init__(parent) newcb = self.create_checkbox introspection_group = QGroupBox(_("Basic features")) goto_definition_box = newcb( _("Enable Go to definition"), 'jedi_definition', tip=_("If enabled, left-clicking on an object name while \n" "pressing the {} key will go to that object's definition\n" "(if resolved).").format(self.CTRL)) follow_imports_box = newcb(_("Follow imports when going to a " "definition"), 'jedi_definition/follow_imports') show_signature_box = newcb(_("Show calltips"), 'jedi_signature_help') enable_hover_hints_box = newcb( _("Enable hover hints"), 'enable_hover_hints', tip=_("If enabled, hovering the mouse pointer over an object\n" "name will display that object's signature and/or\n" "docstring (if present).")) introspection_layout = QVBoxLayout() introspection_layout.addWidget(goto_definition_box) introspection_layout.addWidget(follow_imports_box) introspection_layout.addWidget(show_signature_box) introspection_layout.addWidget(enable_hover_hints_box) introspection_group.setLayout(introspection_layout) goto_definition_box.toggled.connect(follow_imports_box.setEnabled) # Advanced group advanced_group = QGroupBox(_("Advanced")) modules_textedit = self.create_textedit( _("Preload the following modules to make completion faster " "and more accurate:"), 'preload_modules' ) if is_dark_interface(): modules_textedit.textbox.setStyleSheet( "border: 1px solid #32414B;" ) advanced_layout = QVBoxLayout() advanced_layout.addWidget(modules_textedit) advanced_group.setLayout(advanced_layout) layout = QVBoxLayout() layout.addWidget(introspection_group) layout.addWidget(advanced_group) layout.addStretch(1) self.setLayout(layout)
def setupUI(self): mainLayout = QGridLayout() leftColumnWidget = QGroupBox(config.thisTranslation["commentaries"]) commentaryLayout = QVBoxLayout() commentaryLayout.addWidget(self.commentaryListView()) subSubLayout = QHBoxLayout() button = QPushButton(config.thisTranslation["open"]) button.clicked.connect(self.openPreviousCommentary) subSubLayout.addWidget(button) button = QPushButton(config.thisTranslation["activeOnly"]) button.clicked.connect(self.showActiveOnlyCommentaries) subSubLayout.addWidget(button) commentaryLayout.addLayout(subSubLayout) leftColumnWidget.setLayout(commentaryLayout) rightColumnWidget = QGroupBox(config.thisTranslation["menu10_books"]) bookLayout = QHBoxLayout() subLayout = QVBoxLayout() subLayout.addWidget(self.bookListView()) subSubLayout = QHBoxLayout() button = QPushButton(config.thisTranslation["showAll"]) button.clicked.connect(self.showAllBooks) subSubLayout.addWidget(button) button = QPushButton(config.thisTranslation["favouriteOnly"]) button.clicked.connect(self.favouriteBookOnly) subSubLayout.addWidget(button) button = QPushButton(config.thisTranslation["addFavourite"]) button.clicked.connect(self.addFavorite) subSubLayout.addWidget(button) button = QPushButton(config.thisTranslation["removeFavourite"]) button.clicked.connect(self.removeFavorite) subSubLayout.addWidget(button) subLayout.addLayout(subSubLayout) bookLayout.addLayout(subLayout) subLayout = QVBoxLayout() subLayout.addWidget(self.chapterListView()) button = QPushButton(config.thisTranslation["open"]) button.clicked.connect(self.openPreviousBookChapter) subLayout.addWidget(button) bookLayout.addLayout(subLayout) rightColumnWidget.setLayout(bookLayout) mainLayout.addWidget(leftColumnWidget, 0, 0) mainLayout.addWidget(rightColumnWidget, 0, 1) mainLayout.setColumnStretch(1, 2) self.setLayout(mainLayout)
def setupUI(self): mainLayout = QHBoxLayout() leftColumnWidget = QGroupBox(config.thisTranslation["pdfDocument"]) pdfLayout = QVBoxLayout() pdfLayout.addWidget(self.pdfListView()) buttons = QHBoxLayout() button = QPushButton(config.thisTranslation["open"]) button.clicked.connect(self.openPreviousPdf) buttons.addWidget(button) button = QPushButton(config.thisTranslation["import"]) button.clicked.connect(self.parent.parent.importPdfDialog) buttons.addWidget(button) button = QPushButton(config.thisTranslation["others"]) button.clicked.connect(self.parent.parent.openPdfDialog) buttons.addWidget(button) pdfLayout.addLayout(buttons) leftColumnWidget.setLayout(pdfLayout) centerColumnWidget = QGroupBox(config.thisTranslation["wordDocument"]) pdfLayout = QVBoxLayout() pdfLayout.addWidget(self.docxListView()) buttons = QHBoxLayout() button = QPushButton(config.thisTranslation["open"]) button.clicked.connect(self.openPreviousDocx) buttons.addWidget(button) button = QPushButton(config.thisTranslation["import"]) button.clicked.connect(self.parent.parent.importDocxDialog) buttons.addWidget(button) button = QPushButton(config.thisTranslation["others"]) button.clicked.connect(self.parent.parent.openDocxDialog) buttons.addWidget(button) pdfLayout.addLayout(buttons) centerColumnWidget.setLayout(pdfLayout) rightColumnWidget = QGroupBox(config.thisTranslation["devotionals"]) devotionalLayout = QVBoxLayout() devotionalLayout.addWidget(self.devotionsListView()) buttons = QHBoxLayout() button = QPushButton(config.thisTranslation["open"]) button.clicked.connect(self.openDevotional) buttons.addWidget(button) buttons.addWidget(button) devotionalLayout.addLayout(buttons) rightColumnWidget.setLayout(devotionalLayout) mainLayout.addWidget(leftColumnWidget) mainLayout.addWidget(centerColumnWidget) mainLayout.addWidget(rightColumnWidget) self.setLayout(mainLayout)
def setup_page(self): ar_group = QGroupBox(_("Autorefresh")) ar_box = self.create_checkbox(_("Enable autorefresh"), 'autorefresh') ar_spin = self.create_spinbox(_("Refresh interval: "), _(" ms"), 'autorefresh/timeout', min_=100, max_=1000000, step=100) filter_group = QGroupBox(_("Filter")) filter_data = [ ('exclude_private', _("Exclude private references")), ('exclude_capitalized', _("Exclude capitalized references")), ('exclude_uppercase', _("Exclude all-uppercase references")), ('exclude_unsupported', _("Exclude unsupported data types")), ] filter_boxes = [ self.create_checkbox(text, option) for option, text in filter_data ] display_group = QGroupBox(_("Display")) display_data = [('minmax', _("Show arrays min/max"), '')] display_boxes = [ self.create_checkbox(text, option, tip=tip) for option, text, tip in display_data ] ar_layout = QVBoxLayout() ar_layout.addWidget(ar_box) ar_layout.addWidget(ar_spin) ar_group.setLayout(ar_layout) filter_layout = QVBoxLayout() for box in filter_boxes: filter_layout.addWidget(box) filter_group.setLayout(filter_layout) display_layout = QVBoxLayout() for box in display_boxes: display_layout.addWidget(box) display_group.setLayout(display_layout) vlayout = QVBoxLayout() vlayout.addWidget(ar_group) vlayout.addWidget(filter_group) vlayout.addWidget(display_group) vlayout.addStretch(1) self.setLayout(vlayout)
def setup_page(self): settings_group = QGroupBox(_("Settings")) save_box = self.create_checkbox(_("Save file before analyzing it"), 'save_before', default=True) hist_group = QGroupBox(_("History")) hist_label1 = QLabel( _("The following option will be applied at next " "startup.")) hist_label1.setWordWrap(True) hist_spin = self.create_spinbox(_("History: "), _(" results"), 'max_entries', default=50, min_=10, max_=1000000, step=10) results_group = QGroupBox(_("Results")) results_label1 = QLabel(_("Results are stored here:")) results_label1.setWordWrap(True) results_label2 = QLabel(CoalaWidget.DATAPATH) results_label2.setTextInteractionFlags(Qt.TextSelectableByMouse) results_label2.setWordWrap(True) settings_layout = QVBoxLayout() settings_layout.addWidget(save_box) settings_group.setLayout(settings_layout) hist_layout = QVBoxLayout() hist_layout.addWidget(hist_label1) hist_layout.addWidget(hist_spin) hist_group.setLayout(hist_layout) results_layout = QVBoxLayout() results_layout.addWidget(results_label1) results_layout.addWidget(results_label2) results_group.setLayout(results_layout) vlayout = QVBoxLayout() vlayout.addWidget(settings_group) vlayout.addWidget(hist_group) vlayout.addWidget(results_group) vlayout.addStretch(1) self.setLayout(vlayout)
def add_kicklimits_curves(self): grpbx = QGroupBox('Show Kick Limits', self) vbl = QHBoxLayout(grpbx) self.hbl_namev.addWidget(grpbx) chcbox1 = QCheckBox('Kicks', grpbx) chcbox2 = QCheckBox('Delta Kicks', grpbx) chcbox1.setChecked(True) chcbox2.setChecked(True) vbl.addWidget(chcbox1) vbl.addWidget(chcbox2) chcboxs = (chcbox1, chcbox2) names = ('Max Kicks', 'Max dKickx') pvs = ('MaxKick', 'MaxDeltaKick') stys = (4, 2) wids = (3, 2) plns = ('x', 'y') corrs = ('CH', 'CV') for chb, name, pvi, sty, wid in zip(chcboxs, names, pvs, stys, wids): pen = mkPen(QColor(0, 0, 0)) pen.setStyle(sty) pen.setWidth(wid) for pln, corr in zip(plns, corrs): maxkick = InfLine( conv=1e-6, pos=0.0, pen=pen, angle=0, name=name) minkick = InfLine(conv=-1e-6, pos=0.0, pen=pen, angle=0) self.graph[pln].addItem(maxkick) self.graph[pln].addItem(minkick) chan = _ConnSig( self.devpref.substitute(propty=pvi + corr + '-RB')) self._chans.append(chan) chan.new_value_signal[float].connect(maxkick.setValue) chan.new_value_signal[float].connect(minkick.setValue) chb.toggled.connect(maxkick.setVisible) chb.toggled.connect(minkick.setVisible)
def setup_page(self): results_group = QGroupBox(_("Results")) results_label1 = QLabel( _("Profiler plugin results " "(the output of python's profile/cProfile)\n" "are stored here:")) results_label1.setWordWrap(True) # Warning: do not try to regroup the following QLabel contents with # widgets above -- this string was isolated here in a single QLabel # on purpose: to fix Issue 863 results_label2 = QLabel(ProfilerWidget.DATAPATH) results_label2.setTextInteractionFlags(Qt.TextSelectableByMouse) results_label2.setWordWrap(True) results_layout = QVBoxLayout() results_layout.addWidget(results_label1) results_layout.addWidget(results_label2) results_group.setLayout(results_layout) vlayout = QVBoxLayout() vlayout.addWidget(results_group) vlayout.addStretch(1) self.setLayout(vlayout)
def _createGroupWidget(self, title, header, widget_group, wid_type='groupbox'): scr_area_wid = QWidget(self) scr_area_wid.setObjectName('scr_ar_wid') scr_area_wid.setStyleSheet( '#scr_ar_wid {background-color: transparent;}') w_lay = QVBoxLayout(scr_area_wid) w_lay.setSpacing(0) w_lay.setContentsMargins(0, 0, 0, 0) for widget in widget_group: w_lay.addWidget(widget, alignment=Qt.AlignLeft) w_lay.addStretch() scr_area = QScrollArea(self) scr_area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) scr_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) scr_area.setWidgetResizable(True) scr_area.setFrameShape(QFrame.NoFrame) scr_area.setWidget(scr_area_wid) wid = QGroupBox(title, self) if wid_type == 'groupbox' \ else QWidget(self) gb_lay = QVBoxLayout(wid) gb_lay.addWidget(header, alignment=Qt.AlignLeft) gb_lay.addWidget(scr_area) return wid
def __init__(self, parent=None, prefix='', is_main=False): """Init.""" super().__init__(parent) self.setObjectName('ITApp') ld_tienbl = QLabel('Enable Pulses', self, alignment=Qt.AlignCenter) bt_tienblsel = PyDMStateButton( self, prefix + 'IT-EGH:TI-TrigGen:ChanOut-Sel') led_tienblsts = SiriusLedState( self, prefix + 'IT-EGH:TI-TrigGen:ChanOut-Sts') lay = QGridLayout(self) lay.setAlignment(Qt.AlignCenter) lay.setContentsMargins(0, 0, 0, 0) glay = QGridLayout() glay.addWidget(ld_tienbl, 0, 0, 1, 2) glay.addWidget(bt_tienblsel, 1, 0) glay.addWidget(led_tienblsts, 1, 1) if not is_main: gbox = QGroupBox('Timing', self) gbox.setLayout(glay) lay.addWidget(gbox) else: lb_title = QLabel('<h3>IT - Timing</h3>', self, alignment=Qt.AlignCenter) lay.setHorizontalSpacing(15) lay.setVerticalSpacing(15) lay.addWidget(lb_title, 0, 0) lay.addLayout(glay, 1, 0)
def connection_changed(self, connected): build = (self._node is None) and (self._connected != connected and connected is True) super(SystemLog, self).connection_changed(connected) if not build: return self._node = nodeFromAddress(self.channel) self._path = self.channel.replace('SystemLog', 'ClearLog') vb = QVBoxLayout() self.setLayout(vb) gb = QGroupBox('System Log (20 most recent entries)') vb.addWidget(gb) vb = QVBoxLayout() gb.setLayout(vb) self._systemLog = QTreeWidget() vb.addWidget(self._systemLog) self._systemLog.setColumnCount(2) self._systemLog.setHeaderLabels(['Field', 'Value']) self._systemLog.setColumnWidth(0, 200) self._pb = PyDMPushButton(label='Clear Log', pressValue=1, init_channel=self._path) vb.addWidget(self._pb)
def __init__(self, model, parent=None): super().__init__(parent) self.model = model self._lb_connected = QLabel("OFF") self._pb_re_manager_connect = QPushButton("Connect") self._pb_re_manager_connect.clicked.connect( self._pb_re_manager_connect_clicked) self._pb_re_manager_disconnect = QPushButton("Disconnect") self._pb_re_manager_disconnect.clicked.connect( self._pb_re_manager_disconnect_clicked) self._group_box = QGroupBox("Queue Server") vbox = QVBoxLayout() vbox.addWidget(self._lb_connected, alignment=Qt.AlignHCenter) vbox.addWidget(self._pb_re_manager_connect) vbox.addWidget(self._pb_re_manager_disconnect) self._group_box.setLayout(vbox) vbox = QVBoxLayout() vbox.addWidget(self._group_box) self.setLayout(vbox) # Thread used to initiate periodic status updates self._thread = None self.updates_activated = False self.update_period = 1 # Status update period in seconds self._update_widget_states() self.model.events.status_changed.connect(self.on_update_widgets)
def _dock_add_group_box(self, name, *, collapse=None, layout=None): layout = self._dock_layout if layout is None else layout hlayout = QVBoxLayout() widget = QGroupBox(name) widget.setLayout(hlayout) self._layout_add_widget(layout, widget) return hlayout
def __init__(self, item, parent_layout): super(FloatArrayWidget, self).__init__(item, parent_layout) _label = item.get_prop_value("display", "label") self.groupbox = self.group = QGroupBox(_label) self.layout = QGridLayout() self.layout.setAlignment(Qt.AlignLeft) self.groupbox.setLayout(self.layout) self.first_line, self.dim_label = get_image_layout( "shape.png", _("Number of rows x Number of columns")) edit_button = QPushButton(get_icon("arredit.png"), "") edit_button.setToolTip(_("Edit array contents")) edit_button.setMaximumWidth(32) self.first_line.addWidget(edit_button) self.layout.addLayout(self.first_line, 0, 0) self.min_line, self.min_label = get_image_layout( "min.png", _("Smallest element in array")) self.layout.addLayout(self.min_line, 1, 0) self.max_line, self.max_label = get_image_layout( "max.png", _("Largest element in array")) self.layout.addLayout(self.max_line, 2, 0) edit_button.clicked.connect(self.edit_array) self.arr = None # le tableau si il a été modifié self.instance = None
def add_saving_panel(self, row): """ Saving/Export panel """ self.save_data_panel = QGroupBox() self.save_data_layout = QGridLayout() self.export_button = add_button( "To brainrender", self.save_data_layout, self.export_to_brainrender, 0, 0, visibility=False, ) self.save_button = add_button("Save", self.save_data_layout, self.save, 0, 1, visibility=False) self.save_data_layout.setColumnMinimumWidth(1, COLUMN_WIDTH) self.save_data_panel.setLayout(self.save_data_layout) self.layout.addWidget(self.save_data_panel, row, 0, 1, 2) self.save_data_panel.setVisible(False)
def setup_layout(self, clear_data=True): """creates the sidebar visual layout""" vbox = QVBoxLayout() hbox_name = QHBoxLayout() hbox_add_edit = QHBoxLayout() hbox_name.addWidget(self.name_label) hbox_name.addWidget(self.name_pulldown) vbox.addLayout(hbox_name) vbox.addLayout(hbox_add_edit) vbox.addWidget(self.result_case_window) vbox.addWidget(self.result_data_window) if self.show_pulldown: vbox.addWidget(self.pulldown) #vbox.addWidget(self.apply_button) hbox_add_edit.addWidget(self.add_button) hbox_add_edit.addWidget(self.edit_button) group_name_clipboard = QGroupBox('Clipboard') clipboard_vbox = QVBoxLayout() clipboard_vbox.addWidget(self.copy_button) clipboard_vbox.addWidget(self.cut_button) clipboard_vbox.addWidget(self.paste_button) group_name_clipboard.setLayout(clipboard_vbox) vbox.addWidget(group_name_clipboard) vbox.addWidget(self.delete_button) self.setLayout(vbox) if clear_data: self.clear_data()
def _setupTriggerWidget(self): self._ld_trigsts = QLabel('Status', self) self._led_trigsts = SiriusLedState( self, self.prefix + self.dev_pref + ':EG-TriggerPS:status') self._ld_trigall = QLabel('Trigger Allow', self) self._led_trigall = SiriusLedState( self, self.prefix + self.dev_pref + ':EG-TriggerPS:allow') self._ld_trigenbl = QLabel('Trigger', self) self._bt_trigenblsel = PyDMStateButton( self, self.prefix + self.dev_pref + ':EG-TriggerPS:enable') self._led_trigenblsts = SiriusLedState( self, self.prefix + self.dev_pref + ':EG-TriggerPS:enablereal') wid = QGroupBox('Trigger', self) lay = QGridLayout(wid) lay.addWidget(self._ld_trigsts, 0, 0, 1, 2) lay.addWidget(self._led_trigsts, 1, 0, 1, 2) lay.addWidget(self._ld_trigall, 2, 0, 1, 2) lay.addWidget(self._led_trigall, 3, 0, 1, 2) lay.addWidget(self._ld_trigenbl, 4, 0, 1, 2) lay.addWidget(self._bt_trigenblsel, 5, 0) lay.addWidget(self._led_trigenblsts, 5, 1) return wid
def setup_roi_fields(self): """Sets up the QGroupBox that displays the ROI dimensions, if selected.""" self.roi_fields = QGroupBox("ROI:") roi_fields_layout = QHBoxLayout() # z roi_fields_layout.addWidget(QLabel("z:"), 0) self.zstart_roi_val = QLabel("0") roi_fields_layout.addWidget(self.zstart_roi_val, 1) roi_fields_layout.addWidget(QLabel("-"), 2) self.zend_roi_val = QLabel("0") roi_fields_layout.addWidget(self.zend_roi_val, 3) # y roi_fields_layout.addWidget(QLabel("y:"), 4) self.ystart_roi_val = QLabel("0") roi_fields_layout.addWidget(self.ystart_roi_val, 5) roi_fields_layout.addWidget(QLabel("-"), 6) self.yend_roi_val = QLabel("0") roi_fields_layout.addWidget(self.yend_roi_val, 7) # x roi_fields_layout.addWidget(QLabel("x:"), 8) self.xstart_roi_val = QLabel("0") roi_fields_layout.addWidget(self.xstart_roi_val, 9) roi_fields_layout.addWidget(QLabel("-"), 10) self.xend_roi_val = QLabel("0") roi_fields_layout.addWidget(self.xend_roi_val, 11) self.roi_fields.setLayout(roi_fields_layout)
def _setupGraphSettingsWidget(self): self._ld_ltfrom = QLabel('Show lifetime from:', self, alignment=Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self._cb_ltfrom = QComboBox() self._cb_ltfrom.addItem('DCCT') self._cb_ltfrom.addItem('BPM') self._cb_ltfrom.currentTextChanged.connect( self._handle_lifetime_type_sel) self._ld_showsmpl = QLabel('Show samples: ', self, alignment=Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self._cb_showsmpl = QCheckBox(self) self._cb_showsmpl.setChecked(True) self._cb_showsmpl.stateChanged.connect(self._handle_samples_visibility) gbox = QGroupBox('Graphs Settings', self) lay = QGridLayout(gbox) lay.addItem(QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum), 0, 0) lay.addWidget(self._ld_ltfrom, 0, 1) lay.addWidget(self._cb_ltfrom, 0, 2) lay.addItem(QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum), 0, 3) lay.addItem(QSpacerItem(1, 1, QSzPlcy.Minimum, QSzPlcy.Expanding), 1, 1, 1, 2) lay.addWidget(self._ld_showsmpl, 2, 1) lay.addWidget(self._cb_showsmpl, 2, 2) return gbox
def __init__(self, model, parent=None): super().__init__(parent) self.model = model self._lb_queue_state = QLabel("STOPPED") self._pb_queue_start = QPushButton("Start") self._pb_queue_start.setEnabled(False) self._pb_queue_start.clicked.connect(self._pb_queue_start_clicked) self._pb_queue_stop = QPushButton("Stop") self._pb_queue_stop.setEnabled(False) self._pb_queue_stop.setCheckable(True) self._pb_queue_stop.clicked.connect(self._pb_queue_stop_clicked) self._group_box = QGroupBox("Queue") vbox = QVBoxLayout() vbox.addWidget(self._lb_queue_state, alignment=Qt.AlignHCenter) vbox.addWidget(self._pb_queue_start) vbox.addWidget(self._pb_queue_stop) self._group_box.setLayout(vbox) vbox = QVBoxLayout() vbox.addWidget(self._group_box) self.setLayout(vbox) self.model.events.status_changed.connect(self.on_update_widgets)
def _create_spectra_display(self): self.plotGroupBox = QGroupBox("Plot layout") self.figure1 = Figure(facecolor=(1, 1, 1), edgecolor=(0, 0, 0)) self.canvas1 = FigureCanvas(self.figure1) self.canvas1.setParent(self.plotGroupBox) self.canvas1.setFocusPolicy(Qt.StrongFocus) self.canvas1.setFocus() self.canvas1.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.canvas1.updateGeometry() self.mpl_toolbar1 = NavigationToolbar(self.canvas1, self.plotGroupBox) self.canvas1.mpl_connect('key_press_event', self.on_key_press) self.figure2 = Figure(facecolor=(1, 1, 1), edgecolor=(0, 0, 0)) self.canvas2 = FigureCanvas(self.figure2) self.canvas2.setParent(self.plotGroupBox) self.mpl_toolbar2 = NavigationToolbar(self.canvas1, self.plotGroupBox) layout = QVBoxLayout() layout.addWidget(self.canvas1) layout.addWidget(self.mpl_toolbar1) layout.addWidget(self.canvas2) layout.addWidget(self.mpl_toolbar2) self.plotGroupBox.setLayout(layout)
def __init__(self, model, parent=None): super().__init__(parent) self.model = model self._pb_env_open = QPushButton("Open") self._pb_env_open.setEnabled(False) self._pb_env_open.clicked.connect(self._pb_env_open_clicked) self._pb_env_close = QPushButton("Close") self._pb_env_close.setEnabled(False) self._pb_env_close.clicked.connect(self._pb_env_close_clicked) self._pb_env_destroy = QPushButton("Destroy") self._pb_env_destroy.setEnabled(False) self._pb_env_destroy.clicked.connect(self._pb_env_destroy_clicked) self._group_box = QGroupBox("Environment") vbox = QVBoxLayout() vbox.addWidget(self._pb_env_open) vbox.addWidget(self._pb_env_close) vbox.addWidget(self._pb_env_destroy) self._group_box.setLayout(vbox) vbox = QVBoxLayout() vbox.addWidget(self._group_box) self.setLayout(vbox) self.model.events.status_changed.connect(self.on_update_widgets)
def __init__(self, parent=None): super(UiLayerArithmeticDialog, self).__init__(parent) # Dialog settings self.setWindowTitle("Layer Arithmetic") self.resize(354, 134) self.layout_vertical = QVBoxLayout(self) # Arithmetic group box self.group_box_arithmetic = QGroupBox(self) self.group_box_arithmetic.setTitle("Formula") self.line_edit_formula = QLineEdit(self.group_box_arithmetic) self.layout_horizontal = QHBoxLayout(self.group_box_arithmetic) self.layout_horizontal.addWidget(self.line_edit_formula) self.layout_vertical.addWidget(self.group_box_arithmetic) # Buttons self.button_box = QDialogButtonBox(self) self.button_box.setOrientation(Qt.Horizontal) self.button_box.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) self.layout_vertical.addWidget(self.button_box)
def initUI(self): addFormulationButton = QPushButton() addFormulationButton.setText("Add formulation") addFormulationButton.setCursor(Qt.PointingHandCursor) self.addFormulationButton = addFormulationButton deleteFormulationButton = QPushButton() deleteFormulationButton.setText("Delete formulation") deleteFormulationButton.setObjectName("deleteFormulationButton") deleteFormulationButton.setDisabled(True) deleteFormulationButton.setCursor(Qt.ForbiddenCursor) self.deleteFormulationButton = deleteFormulationButton sortFormulationsButton = QPushButton() sortFormulationsButton.setText("Sort") sortFormulationsButton.setCursor(Qt.PointingHandCursor) self.sortFormulationsButton = sortFormulationsButton buttonsLayout = QHBoxLayout() buttonsLayout.addWidget(addFormulationButton) buttonsLayout.addWidget(deleteFormulationButton) buttonsLayout.addWidget(sortFormulationsButton) layout = QVBoxLayout() layout.addWidget(self.tableView, 1) layout.addLayout(buttonsLayout, 0) groupBox = QGroupBox() groupBox.setTitle("Formulations") groupBox.setLayout(layout) parentLayout = QVBoxLayout() parentLayout.addWidget(groupBox) self.setLayout(parentLayout)
def _setupBiasPSWidget(self): self._ld_biasswtsel = QLabel('Switch', self) self._bt_biasswtsel = PyDMStateButton( self, self.prefix + self.dev_pref + ':EG-BiasPS:switch') self._ld_biasswtsts = QLabel('Status', self) self._led_biassswtsts = SiriusLedState( self, self.prefix + self.dev_pref + ':EG-BiasPS:swstatus') self._ld_biasvoltsp = QLabel('Voltage SP [V]', self) self._sb_biasvoltsp = SiriusSpinbox( self, self.prefix + self.dev_pref + ':EG-BiasPS:voltoutsoft') self._sb_biasvoltsp.showStepExponent = False self._ld_biasvoltrb = QLabel('Voltage RB [V]', self) self._lb_biasvoltrb = PyDMLabel( self, self.prefix + self.dev_pref + ':EG-BiasPS:voltinsoft') self._ld_biascurrrb = QLabel('Current RB [A]', self) self._lb_biascurrrb = PyDMLabel( self, self.prefix + self.dev_pref + ':EG-BiasPS:currentinsoft') wid = QGroupBox('Bias Power Supply', self) lay = QGridLayout(wid) lay.addWidget(self._ld_biasswtsel, 0, 0) lay.addWidget(self._bt_biasswtsel, 1, 0) lay.addWidget(self._ld_biasswtsts, 0, 1) lay.addWidget(self._led_biassswtsts, 1, 1) lay.addWidget(self._ld_biasvoltsp, 0, 2) lay.addWidget(self._sb_biasvoltsp, 1, 2) lay.addWidget(self._ld_biasvoltrb, 0, 3) lay.addWidget(self._lb_biasvoltrb, 1, 3) lay.addWidget(self._ld_biascurrrb, 0, 4) lay.addWidget(self._lb_biascurrrb, 1, 4) return wid