def next(self): self.sweep_panel.clear() screen = self.sweep_panel.new_screen() screen.setLayout(QtGui.QFormLayout()) for i in range(10): self.index += 1 screen.layout().addRow('Row #' + str(self.index), QtGui.QLineEdit(i * 'blah ', screen))
def __init__(self, parent, proc_exec_panel, context): super(ExecContextWidget, self).__init__(parent) self.proc_exec_panel = proc_exec_panel self.context = context self.setLayout(QtGui.QVBoxLayout()) if context['proc_doc']: doc_label = QtGui.QTextEdit(self) doc_label.setReadOnly(True) doc_label.setPlainText(context['proc_doc']) self.layout().addWidget(doc_label) self.param_layout = QtGui.QFormLayout() self.param_layout.setLabelAlignment(QtCore.Qt.AlignRight) self.layout().addLayout(self.param_layout) lb = QtGui.QLabel(', '.join(context['needed_features']) or 'None', self) self.param_layout.addRow('Worker Features', lb) lb = QtGui.QLabel(context['document'] or 'None', self) self.param_layout.addRow('Document', lb) why = context[ 'why_needs_to_run'] and ': ' + context['why_needs_to_run'] or '' lb = QtGui.QLabel( context['needs_to_run'] and 'Yes' + why or 'No' + why, self) self.param_layout.addRow('Needed', lb) why = context['why'] and ': ' + context['why'] or '' lb = QtGui.QLabel( (context['allow_exec'] and 'Yes' or '<font color="#FF8888">No') + str(why), self) self.param_layout.addRow('Ready', lb) input_controler = ContextAttrController(self, 'run', self.context['run']) value_editor = self.proc_exec_panel.EDITOR_FACTORY.create( self, 'bool', input_controler) # value_editor.set_editable() # value_editor.set_busy = lambda: None # value_editor._input_controler = input_controler # input_controler.value_editor = value_editor # value_editor.set_value(self.context['run']) self.param_layout.addRow('Run', value_editor) self.param_layout.addRow(' ', QtGui.QWidget(self)) for param in self.context['params']: controller = ContextParamController(self, param['name'], param) value_editor = self.proc_exec_panel.EDITOR_FACTORY.create( self, param['editor'], controller, options=param['editor_options']) self.param_layout.addRow(param['name'], value_editor)
def __init__(self, parent, proc_exec_panel, node_id, open=True): super(NodeBox, self).__init__(parent) self.proc_exec_panel = proc_exec_panel self.node_id = node_id self.setStyleSheet(self._SS) self.update_label() lo = QtGui.QVBoxLayout() lo.setContentsMargins(0, 10, 0, 0) lo.setSpacing(0) self.setLayout(lo) self._holder = QtGui.QWidget(self) self._holder.setLayout(QtGui.QFormLayout()) lo.addWidget(self._holder) self.setCheckable(True) self.toggled.connect(self._on_toggled) self.setChecked(open)