def buildModuleGroupBox(self): """Layout/construct the ModuleScene UI for this tab.""" groupBox = QGroupBox("Module Policy") layout = QVBoxLayout() # agent.propagate_module_scenes self.module_propagate = QCheckBox( "Propagate module scene information " + "to other modules.") self.module_propagate.setChecked(self.agent.propagate_module_scenes) self.module_propagate.stateChanged.connect(self.modulePropagateChanged) # We only allow this change if the parent does not propagate if self.agent.parent().propagate_module_scenes: self.module_propagate.setDisabled(True) # agent.apply_module_scenes self.module_applyScene = QCheckBox("Apply module scene information " + "from other modules.") self.module_applyScene.setChecked(self.agent.apply_module_scenes) self.module_applyScene.stateChanged.connect(self.moduleApplyChanged) layout.addWidget(self.module_applyScene) layout.addItem(QSpacerItem(5, 5)) layout.addWidget(self.module_propagate) groupBox.setLayout(layout) return groupBox
def buildAttributeGroupBox(self): """Layout/construct the AttributeScene UI for this tab.""" groupBox = QGroupBox("Attribute Policy (Colors)") layout = QVBoxLayout() # agent.propagate_attribute_scenes self.attr_propagate = QCheckBox( "Propagate attribute scene " + "information (e.g. color maps) to other modules.") self.attr_propagate.setChecked(self.agent.propagate_attribute_scenes) self.attr_propagate.stateChanged.connect(self.attrPropagateChanged) # We only allow this change if the parent does not propagate if self.agent.parent().propagate_attribute_scenes: self.attr_propagate.setDisabled(True) # agent.apply_attribute_scenes self.attr_applyScene = QCheckBox("Apply attribute scene information " + "from other modules.") self.attr_applyScene.setChecked(self.agent.apply_attribute_scenes) self.attr_applyScene.stateChanged.connect(self.attrApplyChanged) layout.addWidget(self.attr_applyScene) layout.addItem(QSpacerItem(5, 5)) layout.addWidget(self.attr_propagate) groupBox.setLayout(layout) return groupBox
def setup_toolbar(self): color_widget = ColorWidget() color_widget.color_changed.connect(self.fourier.on_color_change) self.toolBar.addWidget(QLabel("Color:")) self.toolBar.addWidget(color_widget) self.toolBar.addWidget(QLabel("Shape:")) size_spin = QSpinBox(self.toolBar) size_spin.setValue(20) size_spin.valueChanged[int].connect(self.fourier.on_size_change) shape_combo = QComboBox(self.toolBar) shape_combo.activated[str].connect(self.fourier.on_shape_change) shape_combo.addItems(brush_shapes) self.toolBar.addWidget(shape_combo) self.toolBar.addWidget(size_spin) self.toolBar.addWidget(QLabel("Symmetry:")) x_sym = QCheckBox(self.toolBar) x_sym.toggled.connect(self.fourier.on_x_toggle) opp_sym = QCheckBox(self.toolBar) opp_sym.toggled.connect(self.fourier.on_opp_toggle) self.toolBar.addWidget(QLabel("X")) self.toolBar.addWidget(x_sym) y_sym = QCheckBox(self.toolBar) y_sym.toggled.connect(self.fourier.on_y_toggle) self.toolBar.addWidget(QLabel("Y")) self.toolBar.addWidget(y_sym) self.toolBar.addWidget(QLabel("Center")) self.toolBar.addWidget(opp_sym)
def buildHighlightGroupBox(self): """Layout/construct the highlight UI for this tab.""" groupBox = QGroupBox("Highlight Policy") layout = QVBoxLayout() # agent.propagate_highlights self.highlights_propagate = QCheckBox("Propagate highlights to " + "other modules.") self.highlights_propagate.setChecked(self.agent.propagate_highlights) self.highlights_propagate.stateChanged.connect( self.highlightsPropagateChanged) # We only allow this change if the parent does not propagate if self.agent.parent().propagate_highlights: self.highlights_propagate.setDisabled(True) # agent.apply_highlights self.applyHighlights = QCheckBox("Apply highlights from " + "other modules.") self.applyHighlights.setChecked(self.agent.apply_highlights) self.applyHighlights.stateChanged.connect(self.applyHighlightsChanged) layout.addWidget(self.applyHighlights) layout.addItem(QSpacerItem(5, 5)) layout.addWidget(self.highlights_propagate) groupBox.setLayout(layout) return groupBox
def createBinaryOptions(self): """ Binary Analysis Options """ groupBox = QtGui.QGroupBox('Binary Analysis') # Elements cbs_unique_str = QCheckBox('Show unique strings', self) cbs_unique_com = QCheckBox('Show unique comments', self) cbs_unique_calls = QCheckBox('Show unique calls', self) cbs_entropy = QCheckBox('Calculate entropy', self) cutoff_label = QLabel('Connect BB cutoff') sb_cutoff = QSpinBox() sb_cutoff.setRange(1, 40) cutoff_func_label = QLabel('Connect functions cutoff') sbf_cutoff = QSpinBox() sbf_cutoff.setRange(1, 40) # Default states are read from the Config # class and reflected in the GUI cbs_unique_str.setCheckState( self.get_state(self.config.display_unique_strings)) cbs_unique_com.setCheckState( self.get_state(self.config.display_unique_comments)) cbs_unique_calls.setCheckState( self.get_state(self.config.display_unique_calls)) cbs_entropy.setCheckState(self.get_state( self.config.calculate_entropy)) sb_cutoff.setValue(self.config.connect_bb_cutoff) sbf_cutoff.setValue(self.config.connect_func_cutoff) # Connect elements and signals cbs_unique_str.stateChanged.connect(self.string_unique) cbs_unique_com.stateChanged.connect(self.comment_unique) cbs_unique_calls.stateChanged.connect(self.calls_unique) cbs_entropy.stateChanged.connect(self.string_entropy) sb_cutoff.valueChanged[int].connect(self.set_cutoff) sb_cutoff.valueChanged[int].connect(self.set_func_cutoff) vbox = QtGui.QVBoxLayout() vbox.addWidget(cbs_unique_str) vbox.addWidget(cbs_unique_com) vbox.addWidget(cbs_unique_calls) vbox.addWidget(cbs_entropy) vbox.addWidget(cutoff_label) vbox.addWidget(sb_cutoff) vbox.addWidget(cutoff_func_label) vbox.addWidget(sbf_cutoff) vbox.addStretch(1) groupBox.setLayout(vbox) return groupBox
def test_plot_tool_bar_widget_list(self): toolbar = PlotToolBar() widget_list = toolbar.get_widget_list() self.assertEqual(len(widget_list), 3) # tests for immutability widget_list.append(QCheckBox()) self.assertEqual(len(toolbar.get_widget_list()), 3) # tests adding widget checkbox = QCheckBox() toolbar.addWidget(checkbox) self.assertEqual(len(toolbar.get_widget_list()), 4)
def __init__(self, name, tendril, parent=None): super(TendrilWidget, self).__init__(parent) hlayout = QHBoxLayout(self) label = QLabel("&" + name) hlayout.addWidget(label) self.thunker = TendrilThunker(tendril) if tendril.val == True or tendril.val == False: spacer = QSpacerItem(0, 0, hPolicy=QSizePolicy.Expanding, vPolicy=QSizePolicy.Minimum) hlayout.addItem(spacer) checkbox = QCheckBox(self) checkbox.setCheckState( Qt.Checked if tendril.val else Qt.Unchecked) checkbox.stateChanged.connect(self.thunker.update) label.setBuddy(checkbox) hlayout.addWidget(checkbox) else: edit = QLineEdit(str(tendril.val), self) edit.textChanged.connect(self.thunker.update) label.setBuddy(edit) hlayout.addWidget(edit) self.setLayout(hlayout) self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
def __init__(self, *args, **kwargs): self.attr_name = "" self.type_node = "" if kwargs.has_key("attr_name"): self.attr_name = kwargs.pop("attr_name") if kwargs.has_key('type_node'): self.type_node = kwargs.pop('type_node') self.path_uiInfo = path_basedir + "/attr_name_%s.json" % self.attr_name super(Widget_TypeAttribute, self).__init__(*args, **kwargs) self.installEventFilter(self) mainLayout = QHBoxLayout(self) mainLayout.setContentsMargins(0, 0, 0, 0) checkBox = QCheckBox() checkBox.setFixedWidth(10) checkBox.setChecked(True) label = QLabel('%s ( *.%s )' % (self.type_node, self.attr_name)) mainLayout.addWidget(checkBox) mainLayout.addWidget(label) self.setFixedHeight(25) self.checkBox = checkBox self.cmds_checkEvent = [] self.load_check() QtCore.QObject.connect(checkBox, QtCore.SIGNAL("stateChanged(int)"), self.save_check)
def _init_load_options_tab(self, tab): # auto load libs auto_load_libs = QCheckBox(self) auto_load_libs.setText("Automatically load all libraries") auto_load_libs.setChecked(False) self.option_widgets['auto_load_libs'] = auto_load_libs # dependencies list dep_group = QGroupBox("Dependencies") dep_list = QListWidget(self) self.option_widgets['dep_list'] = dep_list sublayout = QVBoxLayout() sublayout.addWidget(dep_list) dep_group.setLayout(sublayout) layout = QVBoxLayout() layout.addWidget(auto_load_libs) layout.addWidget(dep_group) layout.addStretch(0) frame = QFrame(self) frame.setLayout(layout) tab.addTab(frame, "Loading Options")
def add_row(self, *args): """adds a new row entry""" table = self.addeachweek.add_eachweek_table table.setSelectionBehavior(QAbstractItemView.SelectRows) table.setEditTriggers(QAbstractItemView.NoEditTriggers) table.setShowGrid(False) table.setAlternatingRowColors(True) table.setStyleSheet("color:#000000;") if args: table.setRowCount(len(args)) for i, j in enumerate(args): checkbox = QCheckBox() table.setCellWidget(i, 0, checkbox) item = QTableWidgetItem(j['item_no']) table.setItem(i, 1, item) item = QTableWidgetItem(j['item']) table.setItem(i, 2, item) item = QTableWidgetItem(j['category']) table.setItem(i, 3, item) item = QTableWidgetItem(j['rate']) table.setItem(i, 4, item) quantity = QLineEdit() quantity.setValidator(QIntValidator(0, 99999)) table.setCellWidget(i, 5, quantity) table.setColumnWidth(0, table.width() / 9) table.setColumnWidth(1, table.width() / 5) table.setColumnWidth(2, table.width() / 5) table.setColumnWidth(3, table.width() / 5) table.setColumnWidth(4, table.width() / 5)
def __init__(self, args, continuous): self.continuous = continuous gobject.GObject.__init__(self) #start by making our app self.app = QApplication(args) #make a window self.window = QMainWindow() #give the window a name self.window.setWindowTitle("BlatherQt") self.window.setMaximumSize(400, 200) center = QWidget() self.window.setCentralWidget(center) layout = QVBoxLayout() center.setLayout(layout) #make a listen/stop button self.lsbutton = QPushButton("Listen") layout.addWidget(self.lsbutton) #make a continuous button self.ccheckbox = QCheckBox("Continuous Listen") layout.addWidget(self.ccheckbox) #connect the buttons self.lsbutton.clicked.connect(self.lsbutton_clicked) self.ccheckbox.clicked.connect(self.ccheckbox_clicked) #add a label to the UI to display the last command self.label = QLabel() layout.addWidget(self.label) #add the actions for quiting quit_action = QAction(self.window) quit_action.setShortcut('Ctrl+Q') quit_action.triggered.connect(self.accel_quit) self.window.addAction(quit_action)
def createWidgets(self): self.listWidget = Widgets.List.HtmlListWidget(self.state) self.tooltips.append((self.listWidget, """\ <p><b>Recreatable Entries view</b></p> <p>The list of this index's recreatable entries.</p>""")) self.recreateSubentriesCheckBox = QCheckBox("Recreate &Subentries") self.recreateSubentriesCheckBox.setChecked(True) self.tooltips.append((self.recreateSubentriesCheckBox, """\ <p><b>Recreate Subentries</b></p> <p>If checked, when an entry or subentry is recreated, all of its subentries, and their subentries, and so on (if any), will also be recrected if possible.</p>""")) self.recreateButton = QPushButton(QIcon(":/recreate.svg"), "&Recreate") self.recreateButton.setDefault(True) self.recreateButton.setAutoDefault(True) self.tooltips.append((self.recreateButton, """\ <p><b>Recreate</b></p> <p>Recreate the current entry or subentry (and its subentries and their subentries, and so on, if the <b>Recreate Subentries</b> checkbox is checked), and then close the dialog.</p> <p>Note that it is possible to get rid of the recreated entries by clicking <b>Index→Undo</b> immediately after the dialog closes. (Or, at any later time by simply deleting them.)""")) self.deleteButton = QPushButton(QIcon(":/delete.svg"), "&Delete...") self.tooltips.append((self.deleteButton, """\ <p><b>Delete</b></p> <p>Permanently delete the current recreatable entry or subentry from this index's list of recreatable entries.</p>""")) self.helpButton = QPushButton(QIcon(":/help.svg"), "Help") self.tooltips.append( (self.helpButton, "Help on the Recreate Entries dialog")) self.closeButton = QPushButton(QIcon(":/dialog-close.svg"), "&Close") self.tooltips.append((self.closeButton, """<p><b>Close</b></p> <p>Close the dialog.</p>"""))
def buildColorStepsControl(self): """Builds the portion of this widget for color cycling options.""" widget = QWidget() layout = QHBoxLayout() self.stepBox = QCheckBox(self.color_step_label) self.stepBox.stateChanged.connect(self.colorstepsChange) self.stepEdit = QLineEdit("8", self) # Setting max to sys.maxint in the validator causes an overflow! D: self.stepEdit.setValidator(QIntValidator(1, 65536, self.stepEdit)) self.stepEdit.setEnabled(False) self.stepEdit.editingFinished.connect(self.colorstepsChange) if self.color_step > 0: self.stepBox.setCheckState(Qt.Checked) self.stepEdit.setEnabled(True) layout.addWidget(self.stepBox) layout.addItem(QSpacerItem(5, 5)) layout.addWidget(QLabel("with")) layout.addItem(QSpacerItem(5, 5)) layout.addWidget(self.stepEdit) layout.addItem(QSpacerItem(5, 5)) layout.addWidget(QLabel(self.number_steps_label)) widget.setLayout(layout) return widget
def __init__(self, text, validator, minValue, maxValue): QWidget.__init__(self) layout = QHBoxLayout(self) checkBox = QCheckBox() checkBox.setFixedWidth(115) checkBox.setText(text) layout.addWidget(checkBox) hLayoutX = QHBoxLayout() lineEditXMin = QLineEdit() lineEditXMax = QLineEdit() hLayoutX.addWidget(lineEditXMin) hLayoutX.addWidget(lineEditXMax) lineEditXMin.setValidator(validator) lineEditXMax.setValidator(validator) lineEditXMin.setText(str(minValue)) lineEditXMax.setText(str(maxValue)) hLayoutY = QHBoxLayout() lineEditYMin = QLineEdit() lineEditYMax = QLineEdit() hLayoutY.addWidget(lineEditYMin) hLayoutY.addWidget(lineEditYMax) lineEditYMin.setValidator(validator) lineEditYMax.setValidator(validator) lineEditYMin.setText(str(minValue)) lineEditYMax.setText(str(maxValue)) hLayoutZ = QHBoxLayout() lineEditZMin = QLineEdit() lineEditZMax = QLineEdit() hLayoutZ.addWidget(lineEditZMin) hLayoutZ.addWidget(lineEditZMax) lineEditZMin.setValidator(validator) lineEditZMax.setValidator(validator) lineEditZMin.setText(str(minValue)) lineEditZMax.setText(str(maxValue)) layout.addLayout(hLayoutX) layout.addLayout(hLayoutY) layout.addLayout(hLayoutZ) self.checkBox = checkBox self.lineEditX_min = lineEditXMin self.lineEditX_max = lineEditXMax self.lineEditY_min = lineEditYMin self.lineEditY_max = lineEditYMax self.lineEditZ_min = lineEditZMin self.lineEditZ_max = lineEditZMax self.lineEdits = [ lineEditXMin, lineEditXMax, lineEditYMin, lineEditYMax, lineEditZMin, lineEditZMax ] QtCore.QObject.connect(checkBox, QtCore.SIGNAL("clicked()"), self.updateEnabled) self.updateEnabled()
def createVulnOptions(self): """ Vulnerability Discovery related """ groupBox = QtGui.QGroupBox('Vulnerability Discovery') # Elements cbv_deep_dang = QCheckBox('Deep search for dangerous functions') # xxx = QCheckBox('blah') # Default states are read from the Options # class and reflected in the GUI cbv_deep_dang.setCheckState( self.get_state(self.config.deep_dangerous_functions)) # Connect elements and signals cbv_deep_dang.stateChanged.connect(self.deep_dangerous) vbox = QtGui.QVBoxLayout() vbox.addWidget(cbv_deep_dang) # vbox.addWidget(xxx) vbox.addStretch(1) groupBox.setLayout(vbox) return groupBox
def _setupUi(self): self.setMinimumWidth(800) self.setMinimumHeight(600) layout = QVBoxLayout() self.setLayout(layout) self.editPmCmd = QLineEdit() layout.addWidget(self.editPmCmd) self.modesWidget = QWidget() self.modesLayout = QHBoxLayout() self.modesWidget.setLayout(self.modesLayout) layout.addWidget(self.modesWidget) self.checkBoxes = [] for mode in 'create query edit'.split(): chkBox = QCheckBox(mode) chkBox.setProperty('mode', mode) self.checkBoxes.append(chkBox) for checkBox in self.checkBoxes: self.modesLayout.addWidget(checkBox) checkBox.setChecked(True) if self.command: self.updateDocs() else: layout.addStretch()
def addCamerasToStackedWidget(self, names): for name in names: btn = QCheckBox(name, self) btn.clicked.connect(self.toggleSelectedAllButton3) btn.setChecked(True) self.cameraLayout.addWidget(btn) self.cameraButtons.append(btn)
def __init__(self, editor, layout=None, *args, **kw): super(_FilterTableView, self).__init__(editor, *args, **kw) # layout = QVBoxLayout() # layout.setSpacing(1) # self.table = table = _TableView(parent) hl = QHBoxLayout() # hl.setSpacing(10) # self.button = button = QPushButton() button.setIcon(icon('delete').create_icon()) button.setEnabled(False) button.setFlat(True) button.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) button.setFixedWidth(15) button.setFixedHeight(15) self.text = text = QLineEdit() self.cb = cb = QCheckBox() # text.setEnabled(False) button.setEnabled(False) # table.setEnabled(False) # cb.setSizePolicy(QSizePolicy.Fixed, # QSizePolicy.Fixed) # cb.setFixedWidth(20) # cb.setFixedHeight(20) # hl.addWidget(cb) hl.addWidget(text) hl.addWidget(button) layout.addLayout(hl)
def __init__(self, parent): global configuration super(EditConfigurationDialog, self).__init__(parent) title = _("Preferences") self.setWindowTitle(title) self.title_widget = TitleWidget(title, self) self.buttons = QDialogButtonBox() self.buttons.addButton(QDialogButtonBox.Ok) self.buttons.addButton(QDialogButtonBox.Cancel) self.font_select = QCheckBox() self.server_address = QLineEdit() form_layout = QFormLayout() form_layout.addRow(_("Fonts"), self.font_select) form_layout.addRow(_("Server's IP address"), self.server_address) top_layout = QVBoxLayout() top_layout.addWidget(self.title_widget) top_layout.addLayout(form_layout) top_layout.addWidget(self.buttons) self.setLayout(top_layout) # QWidget takes ownership of the layout self.buttons.accepted.connect(self.save_and_accept) self.buttons.rejected.connect(self.cancel) self._load_configuration(configuration)
def __init__(self, *args, **kwargs ): QWidget.__init__( self, *args, **kwargs ) mainLayout = QHBoxLayout( self ) mainLayout.setContentsMargins(0,0,0,0) label = QLabel( "Aim Direction : " ) lineEdit1 = QLineEdit() lineEdit2 = QLineEdit() lineEdit3 = QLineEdit() verticalSeparator = Widget_verticalSeparator() checkBox = QCheckBox( "Set Auto" ) mainLayout.addWidget( label ) mainLayout.addWidget( lineEdit1 ) mainLayout.addWidget( lineEdit2 ) mainLayout.addWidget( lineEdit3 ) mainLayout.addWidget( verticalSeparator ) mainLayout.addWidget( checkBox ) validator = QDoubleValidator( -10000.0, 10000.0, 2 ) lineEdit1.setValidator( validator ) lineEdit2.setValidator( validator ) lineEdit3.setValidator( validator ) lineEdit1.setText( "0.0" ) lineEdit2.setText( "1.0" ) lineEdit3.setText( "0.0" ) checkBox.setChecked( True ) self.label = label; self.lineEdit1 = lineEdit1; self.lineEdit2 = lineEdit2; self.lineEdit3 = lineEdit3; self.checkBox = checkBox self.setVectorEnabled() QtCore.QObject.connect( checkBox, QtCore.SIGNAL( 'clicked()' ), self.setVectorEnabled )
def createEditor(self, parent, option, index): if not index.isValid(): return QSqlRelationalDelegate.createEditor(self, parent, option, index) if index.column() in self.__read_only: return None elif index.column() in self.__dates: return QDateEdit(QDate.currentDate(), parent) elif index.column() in self.__booleens: editor = QCheckBox("", parent) r = self.checkBoxRect(option, editor) rect = option.rect rect.moveTo(r.x(), r.y()) rect.setWidth(r.width()) rect.setHeight(r.height()) editor.setGeometry(rect) editor.setAutoFillBackground(True) return editor elif index.column() in self.__numbers: editor = QSpinBox(parent) editor.setMinimum(0) editor.setMaximum(100) return editor return QSqlRelationalDelegate.createEditor(self, parent, option, index)
def __init__(self, *args, **kwargs): super(HotkeyDialogView, self).__init__(*args, **kwargs) self.setWindowTitle("Set Hotkey") self.edit_line = QLineEdit() self.edit_line.setEnabled(False) self.installEventFilter(self) self.ok_btn = QPushButton("&Ok") # noinspection PyUnresolvedReferences self.ok_btn.clicked.connect(self.accept) self.control_check = QCheckBox() self.control_label = QLabel("CTRL") self.shift_check = QCheckBox() self.shift_label = QLabel("SHIFT") self.alt_check = QCheckBox() self.alt_label = QLabel("ALT") self.cancel_btn = QPushButton("&Cancel") # noinspection PyUnresolvedReferences self.cancel_btn.clicked.connect(self.reject) self.h_keys_layout = QHBoxLayout() self.h_btn_layout = QHBoxLayout() self.v_layout = QVBoxLayout() self.h_btn_layout.addStretch(0) self.h_btn_layout.addWidget(self.ok_btn) self.h_btn_layout.addWidget(self.cancel_btn) self.h_keys_layout.addWidget(self.control_check) self.h_keys_layout.addWidget(self.control_label) self.h_keys_layout.addWidget(self.shift_check) self.h_keys_layout.addWidget(self.shift_label) self.h_keys_layout.addWidget(self.alt_check) self.h_keys_layout.addWidget(self.alt_label) self.h_keys_layout.addWidget(self.edit_line) self.v_layout.addLayout(self.h_keys_layout) self.v_layout.addLayout(self.h_btn_layout) self.setLayout(self.v_layout) # noinspection PyUnresolvedReferences self.accepted.connect(self.on_accept) # noinspection PyUnresolvedReferences self.rejected.connect(self.on_reject) self.__key = None
def __init__(self, parent=None): super(LoggingOptions, self).__init__() self.setTitle('Logging Options') self.layout = QVBoxLayout(self) self.chbox_include_timestamps = QCheckBox('Include timestamps') self.layout.addWidget(self.chbox_include_timestamps) self.chbox_equal_lines = QCheckBox(("Ignore if timestamps and values " "don't change")) self.layout.addWidget(self.chbox_equal_lines) self.hbox_bad_quality = QHBoxLayout(self) self.label_bad_quality = QLabel(('Value to log if reading ' 'quality is bad'), self) self.hbox_bad_quality.addWidget(self.label_bad_quality) self.le_bad_quality = QLineEdit(self) self.le_bad_quality.setText('bad') regex = QRegExp('[a-zA-Z0-9]+') validator = QRegExpValidator(regex) self.le_bad_quality.setValidator(validator) self.hbox_bad_quality.addWidget(self.le_bad_quality) self.layout.addLayout(self.hbox_bad_quality) self.hbox_separator = QHBoxLayout(self) self.label_separator = QLabel('CSV separator', self) self.hbox_separator.addWidget(self.label_separator) self.le_separator = QLineEdit(self) self.le_separator.setText(';') self.hbox_separator.addWidget(self.le_separator) self.layout.addLayout(self.hbox_separator) self.chbox_print_exceptions = QCheckBox(('Print exceptions as ' 'comment')) self.layout.addWidget(self.chbox_print_exceptions) self.hbox_comment_char = QHBoxLayout(self) self.label_comment_char = QLabel('Comment escape character', self) self.hbox_comment_char.addWidget(self.label_comment_char) self.le_comment_char = QLineEdit(self) self.le_comment_char.setText("'") self.hbox_comment_char.addWidget(self.le_comment_char) self.layout.addLayout(self.hbox_comment_char) self.setLayout(self.layout)
def addObjects(self): for obj in exportutils.getObjects(): btn = QCheckBox(obj, self) self.objectsLayout.addWidget(btn) self.objectButtons.append(btn) map(lambda btn: btn.clicked.connect(self.setSelectAllButton2), self.objectButtons)
def _setUpSelectionCheckBox(self): self._selectionCheckBox = QCheckBox() self._selectionCheckBox.setChecked(True) infoText = "Select or deselect this data (e.g. to be included in plots and computations)." self._selectionCheckBox.setStatusTip(infoText) self._selectionCheckBox.setToolTip(infoText) self._selectionCheckBox.stateChanged.connect(self._selectionChanged)
def __init__( self, *args, **kwargs ): QWidget.__init__( self, *args, **kwargs ) self.installEventFilter( self ) self.layout = QVBoxLayout( self ) self.layout.setContentsMargins( 0,0,0,0 ) self.checkBox = QCheckBox( "To Parent" ) self.layout.addWidget( self.checkBox )
def addLayers(self): for layer in PlayListUtils.getDisplayLayers(): btn = QCheckBox(layer.name(), self) btn.setChecked(layer.visibility.get()) self.layerLayout.addWidget(btn) self.layerButtons.append(btn) self.setSelectAllButton() map(lambda btn: btn.clicked.connect(self.setSelectAllButton), self.layerButtons)
def _init_cfg_options_tab(self, tab): resolve_indirect_jumps = QCheckBox(self) resolve_indirect_jumps.setText('Resolve indirect jumps') resolve_indirect_jumps.setChecked(True) self.option_widgets['resolve_indirect_jumps'] = resolve_indirect_jumps collect_data_refs = QCheckBox(self) collect_data_refs.setText( 'Collect cross-references and infer data types') collect_data_refs.setChecked(True) self.option_widgets['collect_data_refs'] = collect_data_refs layout = QVBoxLayout() layout.addWidget(resolve_indirect_jumps) layout.addWidget(collect_data_refs) layout.addStretch(0) frame = QFrame(self) frame.setLayout(layout) tab.addTab(frame, 'CFG Options')
def testSignalMapper(self): checkboxMapper = QSignalMapper() box = QCheckBox('check me') box.stateChanged.connect(checkboxMapper.map) checkboxMapper.setMapping(box, box.text()) checkboxMapper.mapped[str].connect(self.cb_changed) self._changed = False box.setChecked(True) self.assert_(self._changed)
def _load_toggle_list(self, prefix, paths, layout): for name in reversed(sorted(paths)): checkbox = QCheckBox() checkbox.setText(name.replace('_', ' ').title()) checkbox.setObjectName(name) paths[name] = checkbox layout.insertWidget(0, checkbox) checkbox.stateChanged.connect( _call(self._put_checkbox, prefix + name, checkbox))