def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) self.fixedThresh = 50 self.percThresh = 5 self.useFixedThreshold = False self.filter0 = True self.setLayout(QVBoxLayout()) self.layout().addWidget(QLabel("Remove features with too many")) options = ["missing values", "zeros"] self.filter_buttons = QButtonGroup(exclusive=True) self.filter_buttons.buttonClicked.connect(self.filterByClicked) for idx, option, in enumerate(options): btn = QRadioButton(self, text=option, checked=idx == 0) self.filter_buttons.addButton(btn, id=idx) self.layout().addWidget(btn) self.layout().addSpacing(20) filter_settings = QGroupBox(title='Threshold:', flat=True) filter_settings.setLayout(QFormLayout()) self.settings_buttons = QButtonGroup(exclusive=True) self.settings_buttons.buttonClicked.connect(self.filterSettingsClicked) btn_perc = QRadioButton(self, text='Percentage', checked=not self.useFixedThreshold) self.settings_buttons.addButton(btn_perc, id=0) self.percSpin = QSpinBox(minimum=0, maximum=100, value=self.percThresh, enabled=not self.useFixedThreshold) self.percSpin.valueChanged[int].connect(self.setPercThresh) self.percSpin.editingFinished.connect(self.edited) btn_fix = QRadioButton(self, text='Fixed', checked=self.useFixedThreshold) self.settings_buttons.addButton(btn_fix, id=1) self.fixedSpin = QSpinBox(minimum=0, maximum=1000000, value=self.fixedThresh, enabled=self.useFixedThreshold) self.fixedSpin.valueChanged[int].connect(self.setFixedThresh) self.fixedSpin.editingFinished.connect(self.edited) filter_settings.layout().addRow(btn_fix, self.fixedSpin) filter_settings.layout().addRow(btn_perc, self.percSpin) self.layout().addWidget(filter_settings)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) layout = QFormLayout(fieldGrowthPolicy=QFormLayout.ExpandingFieldsGrow) layout.setContentsMargins(0, 0, 0, 0) self.nameedit = QLineEdit( placeholderText="Name...", sizePolicy=QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed), ) self.expressionedit = QLineEdit(placeholderText="Expression...") self.attrs_model = itemmodels.VariableListModel(["Select Feature"], parent=self) self.attributescb = gui.OrangeComboBox( minimumContentsLength=16, sizeAdjustPolicy=QComboBox.AdjustToMinimumContentsLengthWithIcon, sizePolicy=QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum), ) self.attributescb.setModel(self.attrs_model) sorted_funcs = sorted(self.FUNCTIONS) self.funcs_model = itemmodels.PyListModelTooltip() self.funcs_model.setParent(self) self.funcs_model[:] = chain(["Select Function"], sorted_funcs) self.funcs_model.tooltips[:] = chain( [""], [self.FUNCTIONS[func].__doc__ for func in sorted_funcs]) self.functionscb = gui.OrangeComboBox( minimumContentsLength=16, sizeAdjustPolicy=QComboBox.AdjustToMinimumContentsLengthWithIcon, sizePolicy=QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum), ) self.functionscb.setModel(self.funcs_model) hbox = QHBoxLayout() hbox.addWidget(self.attributescb) hbox.addWidget(self.functionscb) layout.addRow(self.nameedit, self.expressionedit) layout.addRow(self.tr(""), hbox) self.setLayout(layout) self.nameedit.editingFinished.connect(self._invalidate) self.expressionedit.textChanged.connect(self._invalidate) self.attributescb.currentIndexChanged.connect(self.on_attrs_changed) self.functionscb.currentIndexChanged.connect(self.on_funcs_changed) self._modified = False
def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) self.setLayout(QVBoxLayout()) form = QFormLayout() self.base_cb = QComboBox() self.base_cb.addItems([ "2 (Binary Logarithm)", "e (Natural Logarithm)", "10 (Common Logarithm)" ]) self.base_cb.currentIndexChanged.connect(self.changed) self.base_cb.activated.connect(self.edited) form.addRow("Logarithm Base:", self.base_cb) self.layout().addLayout(form)
def add_specific_parameters(self, parent): form = QFormLayout() self.edits = {} for parameter in self.parameters: edit = self.edits[parameter.arg_name] = QLineEdit() edit.convert = getattr(parameter.arg_type, "convert", parameter.arg_type) validator = getattr(parameter.arg_type, "validator", None) if validator is not None: edit.setValidator(validator) edit.setText(str(parameter.default)) edit.setAlignment(Qt.AlignRight) edit.setFixedWidth(50) form.addRow(parameter.label, edit) parent.layout().addLayout(form)
def add_standard_parameters(self, parent): form = QFormLayout() parent.layout().addLayout(form) self.number_of_vars = edit = QLineEdit() edit.setValidator(pos_int.validator) edit.setText("10") edit.setAlignment(Qt.AlignRight) edit.setFixedWidth(50) form.addRow("Variables", edit) self.name_prefix = edit = QLineEdit() edit.setPlaceholderText(self.default_prefix) edit.setFixedWidth(50) form.addRow("Name prefix", edit)
def __setupUi(self): layout = QFormLayout() layout.setRowWrapPolicy(QFormLayout.WrapAllRows) layout.setFieldGrowthPolicy(QFormLayout.ExpandingFieldsGrow) self.name_edit = LineEdit(self) self.name_edit.setPlaceholderText(self.tr("无标题")) self.name_edit.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) self.desc_edit = QTextEdit(self) self.desc_edit.setTabChangesFocus(True) layout.addRow(self.tr("标题"), self.name_edit) layout.addRow(self.tr("描述"), self.desc_edit) self.setLayout(layout)
def _add_controls_start_box(self): box = gui.vBox(self.controlArea, True) form = QFormLayout( labelAlignment=Qt.AlignLeft, formAlignment=Qt.AlignLeft, fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow, verticalSpacing=10, ) self.perplexity_spin = gui.spin( box, self, "perplexity", 1, 500, step=1, alignment=Qt.AlignRight, callback=self._invalidate_affinities, ) self.controls.perplexity.setDisabled(self.multiscale) form.addRow("Perplexity:", self.perplexity_spin) form.addRow(gui.checkBox( box, self, "multiscale", label="Preserve global structure", callback=self._multiscale_changed, )) sbe = gui.hBox(self.controlArea, False, addToLayout=False) gui.hSlider( sbe, self, "exaggeration", minValue=1, maxValue=4, step=1, callback=self._invalidate_tsne_embedding, ) form.addRow("Exaggeration:", sbe) sbp = gui.hBox(self.controlArea, False, addToLayout=False) gui.hSlider( sbp, self, "pca_components", minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1, callback=self._invalidate_pca_projection, ) form.addRow("PCA components:", sbp) self.normalize_cbx = gui.checkBox( box, self, "normalize", "Normalize data", callback=self._invalidate_pca_projection, ) form.addRow(self.normalize_cbx) box.layout().addLayout(form) gui.separator(box, 10) self.run_button = gui.button(box, self, "Start", callback=self._toggle_run) self.para_box = [] self._add_ann_box() self.para_box[0].hide()
def add_main_layout(self): # this is part of init, pylint: disable=attribute-defined-outside-init form = QFormLayout() form.setFieldGrowthPolicy(form.AllNonFixedFieldsGrow) form.setLabelAlignment(Qt.AlignLeft) gui.widgetBox(self.controlArea, True, orientation=form) form.addRow( "Neurons in hidden layers:", gui.lineEdit( None, self, "hidden_layers_input", orientation=Qt.Horizontal, callback=self.settings_changed, tooltip="A list of integers defining neurons. Length of list " "defines the number of layers. E.g. 4, 2, 2, 3.", placeholderText="e.g. 10,")) form.addRow( "Activation:", gui.comboBox( None, self, "activation_index", orientation=Qt.Horizontal, label="Activation:", items=[i for i in self.act_lbl], callback=self.settings_changed)) form.addRow( "Solver:", gui.comboBox( None, self, "solver_index", orientation=Qt.Horizontal, label="Solver:", items=[i for i in self.solv_lbl], callback=self.settings_changed)) self.reg_label = QLabel() slider = gui.hSlider( None, self, "alpha_index", minValue=0, maxValue=len(self.alphas) - 1, callback=lambda: (self.set_alpha(), self.settings_changed()), createLabel=False) form.addRow(self.reg_label, slider) self.set_alpha() form.addRow( "Maximal number of iterations:", gui.spin( None, self, "max_iterations", 10, 1000000, step=10, label="Max iterations:", orientation=Qt.Horizontal, alignment=Qt.AlignRight, callback=self.settings_changed)) form.addRow( gui.checkBox( None, self, "replicable", label="Replicable training", callback=self.settings_changed, attribute=Qt.WA_LayoutUsesWidgetRect) )
def create_configuration_layout(self): layout = QFormLayout() spin = gui.spin(self, self, "f", minv=8, maxv=SimhashVectorizer.max_f, step=8) spin.editingFinished.connect(self.f_spin_changed) layout.addRow('Simhash size:', spin) spin = gui.spin(self, self, 'shingle_len', minv=1, maxv=100) spin.editingFinished.connect(self.on_change) layout.addRow('Shingle length:', spin) return layout
def __init__(self, parent): super().__init__() self.parent = parent self.api = None form = QFormLayout() form.setContentsMargins(5, 5, 5, 5) self.email_edit = gui.lineEdit(self, self, 'email_input', controlWidth=400) form.addRow('Email:', self.email_edit) self.controlArea.layout().addLayout(form) self.submit_button = gui.button(self.controlArea, self, "OK", self.accept) self.load_credentials()
def __setupUi(self): layout = QFormLayout() layout.setRowWrapPolicy(QFormLayout.WrapAllRows) layout.setFieldGrowthPolicy(QFormLayout.ExpandingFieldsGrow) self.name_edit = LineEdit(self) self.name_edit.setPlaceholderText(self.tr("untitled")) self.name_edit.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) self.desc_edit = QTextEdit(self) self.desc_edit.setTabChangesFocus(True) layout.addRow(self.tr("Title"), self.name_edit) layout.addRow(self.tr("Description"), self.desc_edit) self.__schemeIsUntitled = True self.setLayout(layout)
def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) self.setLayout(QVBoxLayout()) form = QFormLayout() self.__rand_type_cb = QComboBox() self.__rand_type_cb.addItems(["Classes", "Features", "Meta data"]) self.__rand_type_cb.currentIndexChanged.connect(self.changed) self.__rand_type_cb.activated.connect(self.edited) self.__rand_seed_ch = QCheckBox() self.__rand_seed_ch.clicked.connect(self.edited) form.addRow("Randomize:", self.__rand_type_cb) form.addRow("Replicable shuffling:", self.__rand_seed_ch) self.layout().addLayout(form)
def __init__(self): super().__init__() self.data_points_interpolate = None dbox = gui.widgetBox(self.controlArea, "Interpolation") rbox = gui.radioButtons(dbox, self, "input_radio", callback=self._change_input) gui.appendRadioButton(rbox, "Enable automatic interpolation") gui.appendRadioButton(rbox, "Linear interval") ibox = gui.indentedBox(rbox) form = QWidget() formlayout = QFormLayout() form.setLayout(formlayout) ibox.layout().addWidget(form) self.xmin_edit = lineEditFloatOrNone(ibox, self, "xmin", callback=self.commit) formlayout.addRow("Min", self.xmin_edit) self.xmax_edit = lineEditFloatOrNone(ibox, self, "xmax", callback=self.commit) formlayout.addRow("Max", self.xmax_edit) self.dx_edit = lineEditFloatOrNone(ibox, self, "dx", callback=self.commit) formlayout.addRow("Δ", self.dx_edit) gui.appendRadioButton(rbox, "Reference data") self.data = None gui.auto_commit(self.controlArea, self, "autocommit", "Interpolate") self._change_input()
def __init__(self, parent): super().__init__() self.cm_key = CredentialManager('NY Times API Key') self.parent = parent self.api = None form = QFormLayout() form.setContentsMargins(5, 5, 5, 5) self.key_edit = gui.lineEdit(self, self, 'key_input', controlWidth=400) form.addRow('Key:', self.key_edit) self.controlArea.layout().addLayout(form) self.submit_button = gui.button(self.controlArea, self, "OK", self.accept) self.load_credentials()
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._current_palette = "" form = QFormLayout() styles = QStyleFactory.keys() styles = sorted(styles, key=cmp_to_key( lambda a, b: 1 if a.lower() == "windows" and b.lower() == "fusion" else (-1 if a.lower() == "fusion" and b.lower() == "windows" else 0) )) styles = [ (self.DisplayNames.get(st.lower(), st.capitalize()), st) for st in styles ] # Default style with empty userData key so it cleared in # persistent settings, allowing for default style resolution # on application star. styles = [("Default", "")] + styles self.style_cb = style_cb = QComboBox(objectName="style-cb") for name, key in styles: self.style_cb.addItem(name, userData=key) style_cb.currentIndexChanged.connect(self._style_changed) self.colors_cb = colors_cb = QComboBox(objectName="palette-cb") colors_cb.addItem("Default", userData="") colors_cb.addItem("Breeze Light", userData="breeze-light") colors_cb.addItem("Breeze Dark", userData="breeze-dark") colors_cb.addItem("Zion Reversed", userData="zion-reversed") colors_cb.addItem("Dark", userData="dark") form.addRow("Style", style_cb) form.addRow("Color theme", colors_cb) label = QLabel( "<small>Changes will be applied on next application startup.</small>", enabled=False, ) label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) form.addRow(label) self.setLayout(form) self._update_colors_enabled_state() style_cb.currentIndexChanged.connect(self.selectedStyleChanged) colors_cb.currentIndexChanged.connect(self.selectedPaletteChanged)
def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) self.setLayout(QVBoxLayout()) self.__strategy = RandomFeatureSelectEditor.Fixed self.__k = 10 self.__p = 75.0 box = QGroupBox(title="Strategy", flat=True) self.__group = group = QButtonGroup(self, exclusive=True) self.__spins = {} form = QFormLayout() fixedrb = QRadioButton("Fixed", checked=True) group.addButton(fixedrb, RandomFeatureSelectEditor.Fixed) kspin = QSpinBox( minimum=1, value=self.__k, enabled=self.__strategy == RandomFeatureSelectEditor.Fixed, ) kspin.valueChanged[int].connect(self.setK) kspin.editingFinished.connect(self.edited) self.__spins[RandomFeatureSelectEditor.Fixed] = kspin form.addRow(fixedrb, kspin) percrb = QRadioButton("Percentage") group.addButton(percrb, RandomFeatureSelectEditor.Percentage) pspin = QDoubleSpinBox( minimum=0.0, maximum=100.0, singleStep=0.5, value=self.__p, suffix="%", enabled=self.__strategy == RandomFeatureSelectEditor.Percentage, ) pspin.valueChanged[float].connect(self.setP) pspin.editingFinished.connect(self.edited) self.__spins[RandomFeatureSelectEditor.Percentage] = pspin form.addRow(percrb, pspin) self.__group.buttonClicked.connect(self.__on_buttonClicked) box.setLayout(form) self.layout().addWidget(box)
def __init__(self): super().__init__() self.data = None self.embedder = "" self.basename = "" self.type_ext = "" self.compress_ext = "" self.writer = None self.id_smiles_attr = 0 self._embedder = '' self._embedders = list(EMBEDDERS.keys()) self._smiles_attr = '' form = QFormLayout() box = gui.vBox(self.controlArea, "Options") gui.comboBox( box, self, "_smiles_attr", sendSelectedValue=True, callback=self._update_options, ) form.addRow( "SMILES attribute: ", self.controls._smiles_attr ) gui.comboBox( box, self, "_embedder", sendSelectedValue=True, callback=self._update_options, items=self._embedders, ) form.addRow( "Embedder: ", self.controls._embedder ) box.layout().addLayout(form) gui.auto_commit(self.controlArea, self, "auto_commit", "Apply", callback=self.commit, checkbox_label="Apply automatically") self.adjustSize()
def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) self.setLayout(QVBoxLayout()) form = QFormLayout() self.__centercb = QComboBox() self.__centercb.addItems( ["No Centering", "Center by Mean", "Center by Median"]) self.__scalecb = QComboBox() self.__scalecb.addItems(["No scaling", "Scale by SD", "Scale by span"]) form.addRow("Center:", self.__centercb) form.addRow("Scale:", self.__scalecb) self.layout().addLayout(form) self.__centercb.currentIndexChanged.connect(self.changed) self.__scalecb.currentIndexChanged.connect(self.changed) self.__centercb.activated.connect(self.edited) self.__scalecb.activated.connect(self.edited)
def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) layout = QFormLayout() self.controlArea.setLayout(layout) minf, maxf = -sys.float_info.max, sys.float_info.max self.__values = {} self.__editors = {} self.__lines = {} for name, longname in self.integrator.parameters(): v = 0. self.__values[name] = v e = SetXDoubleSpinBox(minimum=minf, maximum=maxf, singleStep=0.5, value=v) e.focusIn = self.activateOptions e.editingFinished.connect(self.edited) def cf(x, name=name): self.edited.emit() return self.set_value(name, x) e.valueChanged[float].connect(cf) self.__editors[name] = e layout.addRow(name, e) l = MovableVline(position=v, label=name) def set_rounded(_, line=l, name=name): cf(float(line.rounded_value()), name) l.sigMoved.connect(set_rounded) self.__lines[name] = l self.focusIn = self.activateOptions self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) self.user_changed = False
def add_main_layout(self): form = QFormLayout() form.setFieldGrowthPolicy(form.AllNonFixedFieldsGrow) form.setVerticalSpacing(25) gui.widgetBox(self.controlArea, True, orientation=form) form.addRow( "Neurons in hidden layers:", gui.lineEdit( None, self, "hidden_layers_input", orientation=Qt.Horizontal, callback=self.settings_changed, tooltip="A list of integers defining neurons. Length of list " "defines the number of layers. E.g. 4, 2, 2, 3.", placeholderText="e.g. 100,")) form.addRow( "Activation:", gui.comboBox( None, self, "activation_index", orientation=Qt.Horizontal, label="Activation:", items=[i for i in self.act_lbl], callback=self.settings_changed)) form.addRow(" ", gui.separator(None, 16)) form.addRow( "Solver:", gui.comboBox( None, self, "solver_index", orientation=Qt.Horizontal, label="Solver:", items=[i for i in self.solv_lbl], callback=self.settings_changed)) self.reg_label = QLabel() slider = gui.hSlider( None, self, "alpha_index", minValue=0, maxValue=len(self.alphas) - 1, callback=lambda: (self.set_alpha(), self.settings_changed()), createLabel=False) form.addRow(self.reg_label, slider) self.set_alpha() form.addRow( "Maximal number of iterations:", gui.spin( None, self, "max_iterations", 10, 10000, step=10, label="Max iterations:", orientation=Qt.Horizontal, alignment=Qt.AlignRight, callback=self.settings_changed))
def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) self.setLayout(QVBoxLayout()) self.rank = 10 self.max_error = 1 form = QFormLayout() self.rspin = QSpinBox(minimum=2, maximum=1000000, value=self.rank) self.rspin.valueChanged[int].connect(self.setR) self.rspin.editingFinished.connect(self.edited) self.espin = QDoubleSpinBox( minimum=0.1, maximum=100.0, singleStep=0.1, value=self.max_error) self.espin.valueChanged[float].connect(self.setE) self.espin.editingFinished.connect(self.edited) form.addRow("Rank:", self.rspin) form.addRow("Relative error:", self.espin) self.layout().addLayout(form)
def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) self._threshold = self.DEFAULT_THRESHOLD self.setLayout(QVBoxLayout()) form = QFormLayout() self.cond_cb = QComboBox() self.cond_cb.addItems(["Greater or Equal", "Greater"]) self.cond_cb.currentIndexChanged.connect(self.changed) self.cond_cb.activated.connect(self.edited) self.thr_spin = QDoubleSpinBox(minimum=0, singleStep=0.5, decimals=1, value=self._threshold) self.thr_spin.valueChanged[float].connect(self._set_threshold) self.thr_spin.editingFinished.connect(self.edited) form.addRow("Condition:", self.cond_cb) form.addRow("Threshold:", self.thr_spin) self.layout().addLayout(form)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.data: Optional[Table] = None self._output_desc: Optional[Dict[str, str]] = None box = gui.widgetBox(self.controlArea, "唯一行标识符") self.idvar_model = itemmodels.VariableListModel( [None], placeholder="行号") self.var_cb = gui.comboBox( box, self, "idvar", model=self.idvar_model, callback=self._invalidate, minimumContentsLength=16, tooltip="包含标识符(如客户的 ID)的列") box = gui.widgetBox(self.controlArea, "筛选") gui.checkBox( box, self, "only_numeric", "忽略非数值特征", callback=self._invalidate) gui.checkBox( box, self, "exclude_zeros", "排除0值", callback=self._invalidate, tooltip="除了缺失值之外,还要省略值为0的行") form = QFormLayout() gui.widgetBox( self.controlArea, "生成特征的名称", orientation=form) form.addRow("项目:", gui.lineEdit( None, self, "item_var_name", callback=self._invalidate, placeholderText=DEFAULT_ITEM_NAME, styleSheet="padding-left: 3px")) form.addRow("值:", gui.lineEdit( None, self, "value_var_name", callback=self._invalidate, placeholderText=DEFAULT_VALUE_NAME, styleSheet="padding-left: 3px")) gui.auto_apply(self.controlArea, self)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.data: Optional[Table] = None self._output_desc: Optional[Dict[str, str]] = None box = gui.widgetBox(self.controlArea, "Unique Row Identifier") self.idvar_model = itemmodels.VariableListModel( [None], placeholder="Row number") self.var_cb = gui.comboBox( box, self, "idvar", model=self.idvar_model, callback=self._invalidate, minimumContentsLength=16, tooltip="A column with identifier, like customer's id") box = gui.widgetBox(self.controlArea, "Filter") gui.checkBox( box, self, "only_numeric", "Ignore non-numeric features", callback=self._invalidate) gui.checkBox( box, self, "exclude_zeros", "Exclude zero values", callback=self._invalidate, tooltip="Besides missing values, also omit items with zero values") form = QFormLayout() gui.widgetBox( self.controlArea, "Names for generated features", orientation=form) form.addRow("Item:", gui.lineEdit( None, self, "item_var_name", callback=self._invalidate, placeholderText=DEFAULT_ITEM_NAME, styleSheet="padding-left: 3px")) form.addRow("Value:", gui.lineEdit( None, self, "value_var_name", callback=self._invalidate, placeholderText=DEFAULT_VALUE_NAME, styleSheet="padding-left: 3px")) gui.auto_apply(self.controlArea, self)
def __init__(self, parent): super().__init__() self.parent = parent self.credentials = None form = QFormLayout() form.setContentsMargins(5, 5, 5, 5) self.key_edit = gui.lineEdit(self, self, "key_input", controlWidth=400) form.addRow("Key:", self.key_edit) self.secret_edit = gui.lineEdit(self, self, "secret_input", controlWidth=400) form.addRow("Secret:", self.secret_edit) self.controlArea.layout().addLayout(form) self.submit_button = gui.button(self.controlArea, self, "OK", self.accept) self.load_credentials()
def __init__(self, parent): super().__init__() self.parent = parent self.api = None form = QFormLayout() form.setContentsMargins(5, 5, 5, 5) self.host_edit = gui.lineEdit(self, self, 'host_input', controlWidth=150) self.user_edit = gui.lineEdit(self, self, 'user_input', controlWidth=150) self.passwd_edit = gui.lineEdit(self, self, 'passwd_input', controlWidth=150) self.passwd_edit.setEchoMode(QLineEdit.Password) tokenbox = gui.vBox(self) self.submit_button = gui.button(tokenbox, self, 'request new token', self.accept, width=100) self.token_edit = gui.lineEdit(tokenbox, self, 'token_input', controlWidth=200) form.addRow('Host:', self.host_edit) form.addRow('username:'******'password:', self.passwd_edit) form.addRow(tokenbox) self.controlArea.layout().addLayout(form) self.load_credentials()
def __init__(self, parent=None, **kwargs): super().__init__(parent, **kwargs) self.setLayout(QVBoxLayout()) self._n_genes = self.DEFAULT_N_GENS self._n_groups = self.DEFAULT_N_GROUPS form = QFormLayout() self.n_genes_spin = QSpinBox(minimum=1, maximum=10**6, value=self._n_genes) self.n_genes_spin.valueChanged[int].connect(self._set_n_genes) self.n_genes_spin.editingFinished.connect(self.edited) form.addRow("Number of genes:", self.n_genes_spin) self.layout().addLayout(form) disp_b = QRadioButton("Dispersion", checked=True) vari_b = QRadioButton("Variance") mean_b = QRadioButton("Mean") self.group = QButtonGroup() self.group.buttonClicked.connect(self._on_button_clicked) for i, button in enumerate([disp_b, vari_b, mean_b]): index = index_to_enum(SelectMostVariableGenes.Method, i).value self.group.addButton(button, index - 1) form.addRow(button) self.stats_check = QCheckBox("Compute statistics for", checked=self.DEFAULT_COMPUTE_STATS) self.stats_check.clicked.connect(self.edited) self.n_groups_spin = QSpinBox(minimum=1, value=self._n_groups) self.n_groups_spin.valueChanged[int].connect(self._set_n_groups) self.n_groups_spin.editingFinished.connect(self.edited) box = QHBoxLayout() box.addWidget(self.stats_check) box.addWidget(self.n_groups_spin) box.addWidget(QLabel("gene groups.")) box.addStretch() self.layout().addLayout(box)
def __init__(self): super().__init__() self.network = None form = QFormLayout() form.setFieldGrowthPolicy(form.AllNonFixedFieldsGrow) gui.widgetBox(self.controlArea, box="Mode indicator", orientation=form) form.addRow( "Feature:", gui.comboBox(None, self, "variable", model=VariableListModel(), callback=self.indicator_changed)) form.addRow( "Connect:", gui.comboBox(None, self, "connect_value", callback=self.connect_combo_changed)) form.addRow( "by:", gui.comboBox(None, self, "connector_value", callback=self.connector_combo_changed)) gui.comboBox(self.controlArea, self, "weighting", box="Edge weights", items=[x.name for x in twomode.Weighting], callback=self.update_output) self.lbout = gui.widgetLabel(gui.hBox(self.controlArea, "Output"), "") self._update_combos() self._set_output_msg()
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) w = self.widget(0) # 'General' tab layout = w.layout() assert isinstance(layout, QFormLayout) cb = QCheckBox(self.tr("Automatically check for updates")) cb.setAttribute(Qt.WA_LayoutUsesWidgetRect) layout.addRow("Updates", cb) self.bind(cb, "checked", "startup/check-updates") # Error Reporting Tab tab = QWidget() self.addTab(tab, self.tr("Error Reporting"), toolTip="Settings related to error reporting") form = QFormLayout() line_edit_mid = QLineEdit() self.bind(line_edit_mid, "text", "error-reporting/machine-id") form.addRow("Machine ID:", line_edit_mid) box = QWidget() layout = QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) cb1 = QCheckBox( self.tr(""), toolTip=self.tr( "Share anonymous usage statistics to improve Orange") ) self.bind(cb1, "checked", "error-reporting/send-statistics") cb1.clicked.connect(UsageStatistics.set_enabled) layout.addWidget(cb1) box.setLayout(layout) form.addRow(self.tr("Share Anonymous Statistics"), box) tab.setLayout(form)
def __init__(self): super().__init__() box = gui.widgetBox(self.controlArea, "Map grid") form = QWidget() formlayout = QFormLayout() form.setLayout(formlayout) box.layout().addWidget(form) self.le1 = lineEditIntOrNone(box, self, "xpoints", callback=self.le1_changed) formlayout.addRow("X dimension", self.le1) self.le3 = lineEditIntOrNone(box, self, "ypoints", callback=self.le3_changed) formlayout.addRow("Y dimension", self.le3) gui.checkBox(box, self, "invert_x", "Invert X axis", callback=lambda: self.commit()) gui.checkBox(box, self, "invert_y", "Invert Y axis", callback=lambda: self.commit()) self.data = None self.set_data(self.data) # show warning gui.auto_commit(self.controlArea, self, "autocommit", "Send Data")