def __init__(self, tab, root_config_path): super(MappingGroupBox, self).__init__("Mapping") self.tab = tab self.main_window = tab.main_window self.root_config_path = root_config_path self.layout = QFormLayout() config = self.tab.main_window.config self.formats = self.get_mapping_formats(config) self.input_label = Label("From:", self.tab, f"{root_config_path}.input_format") self.input_combo = MappingCombo(self.tab, f"{root_config_path}.input_format", self.formats) self.layout.addRow(self.input_label, self.input_combo) self.output_label = Label("To:", self.tab, f"{root_config_path}.output_format") self.output_combo = MappingCombo(self.tab, f"{root_config_path}.output_format", self.formats) self.layout.addRow(self.output_label, self.output_combo) self.setLayout(self.layout)
def __init__(self, win_name, scan, upper_level, lower_level): super(Dialog_Windowing, self).__init__() # Passing the current values if it is an existing option or empty if its a new one self.win_name = win_name self.setWindowIcon( QtGui.QIcon( resource_path("res/images/btn-icons/onkodicom_icon.png"))) self.scan = scan self.upper_level = upper_level self.lower_level = lower_level # Create the ui components for the inputs button_box = QDialogButtonBox( QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self) self.name = QLineEdit() self.name.setText(self.win_name) self.scan_text = QLineEdit() self.scan_text.setText(self.scan) self.upper_level_text = QLineEdit() self.upper_level_text.setText(self.upper_level) self.lower_level_text = QLineEdit() self.lower_level_text.setText(self.lower_level) layout = QFormLayout(self) layout.addRow(QLabel("Window Name:"), self.name) layout.addRow(QLabel("Scan:"), self.scan_text) layout.addRow(QLabel("Upper Value:"), self.upper_level_text) layout.addRow(QLabel("Lower Value:"), self.lower_level_text) layout.addWidget(button_box) button_box.accepted.connect(self.accepting) button_box.rejected.connect(self.reject) self.setWindowTitle("Image Windowing")
def __init__(self, dose, notes): super(Dialog_Dose, self).__init__() # Class variables self.dose = dose self.notes = notes self.setWindowIcon( QtGui.QIcon("res/images/btn-icons/onkodicom_icon.png")) buttonBox = QDialogButtonBox( QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self) self.iso_dose = QLineEdit() self.iso_dose.setText(self.dose) self.iso_unit = QComboBox() self.iso_unit.addItems(["cGy", "%"]) self.iso_notes = QLineEdit() self.iso_notes.setText(self.notes) # Input dialog layout layout = QFormLayout(self) layout.addRow(QLabel("Isodose Level:"), self.iso_dose) layout.addRow(QLabel("Unit:"), self.iso_unit) layout.addRow(QLabel("Notes:"), self.iso_notes) layout.addWidget(buttonBox) buttonBox.accepted.connect(self.accepting) buttonBox.rejected.connect(self.reject) self.setWindowTitle("Isodose Levels")
class MappingGroupBox(QGroupBox): def __init__(self, tab, root_config_path): super(MappingGroupBox, self).__init__("Mapping") self.tab = tab self.main_window = tab.main_window self.root_config_path = root_config_path self.layout = QFormLayout() config = self.tab.main_window.config self.formats = self.get_mapping_formats(config) self.input_label = Label("From:", self.tab, f"{root_config_path}.input_format") self.input_combo = MappingCombo(self.tab, f"{root_config_path}.input_format", self.formats) self.layout.addRow(self.input_label, self.input_combo) self.output_label = Label("To:", self.tab, f"{root_config_path}.output_format") self.output_combo = MappingCombo(self.tab, f"{root_config_path}.output_format", self.formats) self.layout.addRow(self.output_label, self.output_combo) self.setLayout(self.layout) @classmethod def get_mapping_formats(cls, config): return [None] + list( FileMapping(config, "", raise_errors=False).mapping_graph.nodes)
def setup(self, dialog): dialog.resize(320, 132) dialog.setModal(True) dialog.setWindowTitle("Please Login to Continue") self.form_layout = QFormLayout(dialog) self.form_layout.setObjectName("formLayout") self.login_label = QLabel("Server requesting authentication", dialog) self.login_label.setObjectName("login_label") self.form_layout.setWidget(0, QFormLayout.SpanningRole, self.login_label) self.username_label = QLabel(dialog) self.username_label.setObjectName("username_label") self.form_layout.setWidget(1, QFormLayout.LabelRole, self.username_label) self.username = QLineEdit(dialog) self.username.setObjectName("username") self.username.setStatusTip("Enter your username.") self.form_layout.setWidget(1, QFormLayout.FieldRole, self.username) self.password_label = QLabel(dialog) self.password_label.setObjectName("password_label") self.form_layout.setWidget(2, QFormLayout.LabelRole, self.password_label) self.password = QLineEdit(dialog) self.password.setObjectName("password") self.password.setStatusTip("Enter your password.") self.password.setEchoMode(QLineEdit.PasswordEchoOnEdit) self.form_layout.setWidget(2, QFormLayout.FieldRole, self.password) self.save_username = QCheckBox("&Save username", dialog) self.save_username.setObjectName("save_username") self.form_layout.setWidget(3, QFormLayout.FieldRole, self.save_username) self.button_box = QDialogButtonBox(dialog) self.button_box.setObjectName("button_box") self.button_box.setOrientation(Qt.Horizontal) self.button_box.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.form_layout.setWidget(4, QFormLayout.SpanningRole, self.button_box) self.button_box.accepted.connect(dialog.accept) self.button_box.rejected.connect(dialog.close) QMetaObject.connectSlotsByName(dialog)
def __init__(self): super(PatientWeightDialog, self).__init__() # Class variables self.patient_weight_message = "Patient weight is needed for SUV2ROI " self.patient_weight_message += "conversion.\nPlease enter patient " self.patient_weight_message += "weight in kg." # Get stylesheet if platform.system() == 'Darwin': self.stylesheet_path = "res/stylesheet.qss" else: self.stylesheet_path = "res/stylesheet-win-linux.qss" self.stylesheet = open(resource_path(self.stylesheet_path)).read() self.setWindowIcon( QtGui.QIcon("res/images/btn-icons/onkodicom_icon.png")) buttonBox = QDialogButtonBox( QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self) self.patient_weight_message_label = QLabel(self.patient_weight_message) self.patient_weight_prompt = QLabel("Patient Weight:") self.patient_weight_entry = QLineEdit() self.text_font = QtGui.QFont() self.text_font.setPointSize(11) # Set button object names buttonBox.button(QDialogButtonBox.Ok).setProperty( "QPushButtonClass", "success-button") buttonBox.button(QDialogButtonBox.Cancel).setProperty( "QPushButtonClass", "fail-button") # Set stylesheets buttonBox.setStyleSheet(self.stylesheet) self.patient_weight_message_label.setFont(self.text_font) self.patient_weight_message_label.setStyleSheet(self.stylesheet) self.patient_weight_prompt.setMinimumHeight(36) self.patient_weight_prompt.setMargin(4) self.patient_weight_prompt.setFont(self.text_font) self.patient_weight_prompt.setAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignHCenter) self.patient_weight_prompt.setStyleSheet(self.stylesheet) self.patient_weight_entry.setStyleSheet(self.stylesheet) # Input dialog layout entry_layout = QFormLayout(self) entry_layout.addRow(self.patient_weight_message_label) entry_layout.addRow(self.patient_weight_prompt, self.patient_weight_entry) entry_layout.addWidget(buttonBox) buttonBox.accepted.connect(self.accepting) buttonBox.rejected.connect(self.rejecting) self.setWindowTitle("Enter Patient Weight")
def create_gui(self): self.setWindowTitle('Group Editor') icon_path = self.path / 'group.png' icon = QIcon(str(icon_path.resolve())) self.setWindowIcon(icon) form_layout = QFormLayout() self.setLayout(form_layout) form_layout.addRow('Group Name:', self.name) form_layout.addRow('Comments: ', self.comments) form_layout.addRow(self.button_box) self.setLayout(form_layout) self.open()
def setupUi(self, sectionOp): if not sectionOp.objectName(): sectionOp.setObjectName(u"sectionOp") self.formLayout_6 = QFormLayout(sectionOp) self.formLayout_6.setObjectName(u"formLayout_6") self.sectionRulesListWidget = QListWidget(sectionOp) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) self.sectionRulesListWidget.setObjectName(u"sectionRulesListWidget") self.sectionRulesListWidget.setMaximumSize(QSize(16777215, 100)) self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.sectionRulesListWidget) self.label_10 = QLabel(sectionOp) self.label_10.setObjectName(u"label_10") self.label_10.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.label_10) self.sectionCoverageLabel = QLabel(sectionOp) self.sectionCoverageLabel.setObjectName(u"sectionCoverageLabel") self.sectionCoverageLabel.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.sectionCoverageLabel) self.label_11 = QLabel(sectionOp) self.label_11.setObjectName(u"label_11") self.label_11.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(3, QFormLayout.FieldRole, self.label_11) self.retranslateUi(sectionOp) QMetaObject.connectSlotsByName(sectionOp)
def setupUi(self, paceOp): if not paceOp.objectName(): paceOp.setObjectName(u"paceOp") self.formLayout_8 = QFormLayout(paceOp) self.formLayout_8.setObjectName(u"formLayout_8") self.comboBox = QComboBox(paceOp) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_8.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.label_8 = QLabel(paceOp) self.label_8.setObjectName(u"label_8") self.formLayout_8.setWidget(0, QFormLayout.LabelRole, self.label_8) self.retranslateUi(paceOp) QMetaObject.connectSlotsByName(paceOp)
def __init__(self) -> None: super().__init__() self.spinbox_distance = QSpinBox() self.spinbox_cycle_num = QSpinBox() self.int_slider = IntSlider() self.spinbox_stop_interval = QSpinBox() # setup self.spinbox_distance.setRange(1, 100000) self.spinbox_cycle_num.setRange(1, 100000) self.int_slider.range = 1, 50000 self.spinbox_stop_interval.setRange(0, 10000) # setup layout f_layout = QFormLayout(self) f_layout.addRow("Displacement", add_unit(self.spinbox_distance, "μm")) f_layout.addRow("Number of Cycle", add_unit(self.spinbox_cycle_num, "times")) f_layout.addRow("Speed", add_unit(self.int_slider, "μm/sec")) f_layout.addRow("Stop Interval", add_unit(self.spinbox_stop_interval, "msec"))
class Ui_Form(object): def setupUi(self, audioOp): if not audioOp.objectName(): audioOp.setObjectName(u"audioOp") self.formLayout_8 = QFormLayout(audioOp) self.formLayout_8.setObjectName(u"formLayout_8") self.comboBox = QComboBox(audioOp) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_8.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.label_8 = QLabel(audioOp) self.label_8.setObjectName(u"label_8") self.formLayout_8.setWidget(0, QFormLayout.LabelRole, self.label_8) self.retranslateUi(audioOp) QMetaObject.connectSlotsByName(audioOp) # setupUi def retranslateUi(self, audioOp): self.comboBox.setItemText(0, QCoreApplication.translate("Form", u"Mixed section and step audio", None)) self.comboBox.setItemText(1, QCoreApplication.translate("Form", u"Section audio only", None)) self.comboBox.setItemText(2, QCoreApplication.translate("Form", u"Step audio only", None)) self.label_8.setText(QCoreApplication.translate("Form", u"Audio attachment behavior", None)) pass
def __init__(self): QWidget.__init__(self, None) self.ui = Ui_Form() self.setFixedSize(710, 465) self.ui.setupUi(self) self.ui.piclabel.setPixmap(QPixmap("app/UI/pngegg.png")) self.ui.piclabel.setScaledContents(True) self.widget = QWidget() formlayout = QFormLayout() self.blayout = QHBoxLayout() self.vlayout = QVBoxLayout() self.groupBox = QGroupBox() self.ui.editButton.clicked.connect(self.editProfile)
def init_ui(self): self.setFixedSize(200, 100) self.move2center() btn_color: QPushButton = QPushButton('颜色!') btn_color.clicked.connect(self.show_color_dialog) grid = QFormLayout() grid.addRow('换个', btn_color) grid.addRow('开始', self.time_editor_start) grid.addRow('结束', self.time_editor_end) self.setLayout(grid) self.setWindowTitle('Settings')
class MyWidget(QWidget): def __init__(self): super().__init__() self._init_UI() def set_text(self): input_d = QInputDialog(self) res_text, res_ok = input_d.getText(self, "title", "text:") if res_ok: self.text.setText(res_text) def set_title(self): self.setWindowTitle(self.form_name.text()) def _init_UI(self): self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Example 7') self.label_name = QLabel("form name", self) self.text = QTextEdit("kek", self) # self.kek_btn = QLabel("kek", self) self.kek_btn = QPushButton("kek", self) self.form_name = QLineEdit(self.windowTitle(), self) self.layout = QFormLayout(self) self.layout.addRow(self.label_name, self.form_name) self.layout.addRow(self.kek_btn, self.text) self.form_name.textChanged.connect(self.set_title) self.kek_btn.clicked.connect(self.set_text) # self.layout.addWidget(self.kek_btn, 0, 0) # self.layout.addWidget(self.text, 0, 1) self.setLayout(self.layout) self.show()
def tab_microenv(self): layout = QFormLayout() sex = QHBoxLayout() sex.addWidget(QRadioButton("Male")) sex.addWidget(QRadioButton("Female")) layout.addRow(QLabel("Sex"), sex) layout.addRow("Date of Birth", QLineEdit()) # self.setTabText(1,"Microenvironment") self.tab2.setLayout(layout)
def _init_UI(self): self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Example 7') self.label_name = QLabel("form name", self) self.text = QTextEdit("kek", self) # self.kek_btn = QLabel("kek", self) self.kek_btn = QPushButton("kek", self) self.form_name = QLineEdit(self.windowTitle(), self) self.layout = QFormLayout(self) self.layout.addRow(self.label_name, self.form_name) self.layout.addRow(self.kek_btn, self.text) self.form_name.textChanged.connect(self.set_title) self.kek_btn.clicked.connect(self.set_text) # self.layout.addWidget(self.kek_btn, 0, 0) # self.layout.addWidget(self.text, 0, 1) self.setLayout(self.layout) self.show()
def __init__(self): super().__init__() self.setWindowTitle('嵌套布局示例') # 全局布局(1个):水平 wlayout = QHBoxLayout() # 局部布局(4个):水平、竖直、网格、表单 hlayout = QHBoxLayout() vlayout = QVBoxLayout() glayout = QGridLayout() formlayout = QFormLayout() # 局部布局添加部件(例如:按钮) hlayout.addWidget(QPushButton(str(1))) hlayout.addWidget(QPushButton(str(2))) vlayout.addWidget(QPushButton(str(3))) vlayout.addWidget(QPushButton(str(4))) glayout.addWidget(QPushButton(str(5)), 0, 0) glayout.addWidget(QPushButton(str(6)), 0, 1) glayout.addWidget(QPushButton(str(7)), 1, 0) glayout.addWidget(QPushButton(str(8)), 1, 1) formlayout.addWidget(QPushButton(str(9))) formlayout.addWidget(QPushButton(str(10))) formlayout.addWidget(QPushButton(str(11))) formlayout.addWidget(QPushButton(str(12))) # 准备四个部件 hwg = QWidget() vwg = QWidget() gwg = QWidget() fwg = QWidget() # 四个部件设置局部布局 hwg.setLayout(hlayout) vwg.setLayout(vlayout) gwg.setLayout(glayout) fwg.setLayout(formlayout) # 四个部件加至全局布局 wlayout.addWidget(hwg) wlayout.addWidget(vwg) wlayout.addWidget(gwg) wlayout.addWidget(fwg) # 窗体本体设置全局布局 self.setLayout(wlayout)
def __init__(self, parent): super().__init__(parent) self.setWindowFlag(Qt.Window) self.setWindowFlag(Qt.WindowStaysOnTopHint) self.setWindowTitle("Add New Exercise") self.setWindowModality(Qt.WindowModal) self.setLayout(QFormLayout()) self.label_name = QLabel("Exercise Name:", self) self.line_edit_name = QLineEdit(self) self.layout().addRow(self.label_name, self.line_edit_name) self.label_measures = QLabel("Number of Measures:", self) self.spin_box_measures = QSpinBox(self) self.min, self.max = 0, 5 self.spin_box_measures.setRange(self.min, self.max) self.spin_box_measures.valueChanged.connect( self.change_visibility_measure_widgets) self.layout().addRow(self.label_measures, self.spin_box_measures) self.labels_measure_type = [] self.comboboxes_type = [] self.labels_measure_name = [] self.line_edits_measure_name = [] for i in range(self.min, self.max): label_measure_type = QLabel(f"Type of Measure {i + 1}:", self) self.labels_measure_type.append(label_measure_type) combobox_type = QComboBox(self) self.comboboxes_type.append(combobox_type) self.layout().addRow(label_measure_type, combobox_type) combobox_type.hide() label_measure_type.hide() label_measure_name = QLabel(f"Name of Measure {i + 1}:", self) self.labels_measure_name.append(label_measure_name) line_edit_measure_name = QLineEdit(self) self.line_edits_measure_name.append(line_edit_measure_name) self.layout().addRow(label_measure_name, line_edit_measure_name) label_measure_name.hide() line_edit_measure_name.hide() self.button_discard = QPushButton("Discard Exercise", self) self.button_discard.clicked.connect(self.button_discard_action) self.button_add = QPushButton("Add Exercise", self) self.button_add.clicked.connect(self.button_add_action) self.layout().addRow(self.button_discard, self.button_add)
def __init__(self): super(MainWindow, self).__init__() centralWidget = QWidget() self.setCentralWidget(centralWidget) layout = QFormLayout(centralWidget) textLayout = QHBoxLayout() self.text = QLineEdit('Hello, PySide6') self.text.setClearButtonEnabled(True) textLayout.addWidget(self.text) self.sayButton = QPushButton('Say') textLayout.addWidget(self.sayButton) self.text.returnPressed.connect(self.sayButton.animateClick) self.sayButton.clicked.connect(self.say) layout.addRow('Text:', textLayout) self.voiceCombo = QComboBox() layout.addRow('Voice:', self.voiceCombo) self.volumeSlider = QSlider(Qt.Horizontal) self.volumeSlider.setMinimum(0) self.volumeSlider.setMaximum(100) self.volumeSlider.setValue(100) layout.addRow('Volume:', self.volumeSlider) self.engine = None engineNames = QTextToSpeech.availableEngines() if len(engineNames) > 0: engineName = engineNames[0] self.engine = QTextToSpeech(engineName) self.engine.stateChanged.connect(self.stateChanged) self.setWindowTitle( 'QTextToSpeech Example ({})'.format(engineName)) self.voices = [] for voice in self.engine.availableVoices(): self.voices.append(voice) self.voiceCombo.addItem(voice.name()) else: self.setWindowTitle('QTextToSpeech Example (no engines available)') self.sayButton.setEnabled(False)
def __init__(self, standard_name, volume_name): super(Dialog_Volume, self).__init__() # Passing the current values if it is an existing option or empty if its a new one self.standard_name = standard_name self.volume_name = volume_name # Creating the UI components self.setWindowIcon( QtGui.QIcon( resource_path("res/images/btn-icons/onkodicom_icon.png"))) button_box = QDialogButtonBox( QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self) self.standard_name_text = QLineEdit() self.standard_name_text.setText(self.standard_name) self.volume = QLineEdit() self.volume.setText(self.volume_name) layout = QFormLayout(self) layout.addRow(QLabel("Standard Name:"), self.standard_name_text) layout.addRow(QLabel("Volume Name:"), self.volume) layout.addWidget(button_box) button_box.accepted.connect(self.accepting) button_box.rejected.connect(self.reject) self.setWindowTitle("Standard Volume Names")
def __init__(self, parent=None): super(Winform, self).__init__(parent) self.setWindowTitle("窗体布局管理例子") self.resize(400, 100) fromlayout = QFormLayout() labl1 = QLabel("标签1") lineEdit1 = QLineEdit() labl2 = QLabel("标签2") lineEdit2 = QLineEdit() labl3 = QLabel("标签3") lineEdit3 = QLineEdit() fromlayout.addRow(labl1, lineEdit1) fromlayout.addRow(labl2, lineEdit2) fromlayout.addRow(labl3, lineEdit3) self.setLayout(fromlayout)
def __init__(self, currentUser): QWidget.__init__(self, None) self.ui = Ui_Form() self.ui.setupUi(self) self.current_user = currentUser self.ui.searchButton.setIcon(QPixmap("app/UI/search.png")) self.ui.recipepicLabel.setPixmap(QPixmap("app/UI/recipe-book.png")) self.ui.recipepicLabel.setScaledContents(True) self.ui.refreshButton.clicked.connect(self.refresh) self.ui.searchButton.clicked.connect(self.search) self.ui.nameRadioButton.setChecked(True) formlayout = QFormLayout() self.blayout = QHBoxLayout() self.vlayout = QVBoxLayout() self.glayout = [] self.groupBox = QGroupBox() self.viewButton = [] self.editButton = [] self.recipes = [] recipes_info = RECIPE_MODEL.getAllRecipe() for i in reversed(range(self.vlayout.count())): self.vlayout.itemAt(i).widget().setParent(None) for i in range(len(recipes_info)): self.recipes.append( RecipeInMenu(recipes_info[i], self.current_user)) self.vlayout.addWidget(self.recipes[i]) # self.glayout.append(QGridLayout()) # self.glayout[i].addWidget(self.levelLabel,0,0) # self.glayout[i].addWidget(self.viewButton[i],1,0) # self.blayout.addLayout(self.glayout[i]) self.groupBox.setLayout(self.vlayout) self.ui.recipemainScrollArea.setWidget(self.groupBox) self.ui.recipemainScrollArea.setStyleSheet("border-radius: 5px") self.ui.recipemainScrollArea.setWidgetResizable(True)
def __init__(self, parent, data): assert type(data) == BinaryView self.bv = data QDialog.__init__(self, parent) debug_state = binjaplug.get_state(self.bv) self.setWindowTitle("Debug Adapter Settings") self.setMinimumSize(UIContext.getScaledWindowSize(400, 130)) self.setAttribute(Qt.WA_DeleteOnClose) layout = QVBoxLayout() layout.setSpacing(0) titleLabel = QLabel("Adapter Settings") titleLayout = QHBoxLayout() titleLayout.setContentsMargins(0, 0, 0, 0) titleLayout.addWidget(titleLabel) self.adapterEntry = QPushButton(self) self.adapterMenu = QMenu(self) for adapter in DebugAdapter.ADAPTER_TYPE: if not DebugAdapter.ADAPTER_TYPE.can_use(adapter): continue def select_adapter(adapter): return lambda: self.selectAdapter(adapter) self.adapterMenu.addAction(adapter.name, select_adapter(adapter)) if adapter == debug_state.adapter_type: self.adapterEntry.setText(adapter.name) self.adapterEntry.setMenu(self.adapterMenu) self.argumentsEntry = QLineEdit(self) self.addressEntry = QLineEdit(self) self.portEntry = QLineEdit(self) self.requestTerminalEmulator = QCheckBox(self) self.formLayout = QFormLayout() self.formLayout.addRow("Adapter Type", self.adapterEntry) self.formLayout.addRow("Command Line Arguments", self.argumentsEntry) self.formLayout.addRow("Address", self.addressEntry) self.formLayout.addRow("Port", self.portEntry) self.formLayout.addRow("Request Terminal Emulator", self.requestTerminalEmulator) buttonLayout = QHBoxLayout() buttonLayout.setContentsMargins(0, 0, 0, 0) self.cancelButton = QPushButton("Cancel") self.cancelButton.clicked.connect(lambda: self.reject()) self.acceptButton = QPushButton("Accept") self.acceptButton.clicked.connect(lambda: self.accept()) self.acceptButton.setDefault(True) buttonLayout.addStretch(1) buttonLayout.addWidget(self.cancelButton) buttonLayout.addWidget(self.acceptButton) layout.addLayout(titleLayout) layout.addSpacing(10) layout.addLayout(self.formLayout) layout.addStretch(1) layout.addSpacing(10) layout.addLayout(buttonLayout) self.setLayout(layout) self.addressEntry.setText(debug_state.remote_host) self.portEntry.setText(str(debug_state.remote_port)) self.addressEntry.textEdited.connect(lambda: self.apply()) self.portEntry.textEdited.connect(lambda: self.apply()) self.argumentsEntry.setText(' '.join( shlex.quote(arg) for arg in debug_state.command_line_args)) self.argumentsEntry.textEdited.connect(lambda: self.updateArguments()) self.requestTerminalEmulator.setChecked( debug_state.request_terminal_emulator) self.requestTerminalEmulator.stateChanged.connect(lambda: self.apply()) self.accepted.connect(lambda: self.apply())
def __init__(self, parent=None): super(MainWidget, self).__init__(parent) self.chart = QChart() self.series = QBarSeries() self.main_layout = QGridLayout() self.button_layout = QGridLayout() self.font_layout = QFormLayout() self.font_size = QDoubleSpinBox() self.legend_posx = QDoubleSpinBox() self.legend_posy = QDoubleSpinBox() self.legend_width = QDoubleSpinBox() self.legend_height = QDoubleSpinBox() self.detach_legend_button = QPushButton("Toggle attached") self.detach_legend_button.clicked.connect(self.toggle_attached) self.button_layout.addWidget(self.detach_legend_button, 0, 0) self.add_set_button = QPushButton("add barset") self.add_set_button.clicked.connect(self.add_barset) self.button_layout.addWidget(self.add_set_button, 2, 0) self.remove_barset_button = QPushButton("remove barset") self.remove_barset_button.clicked.connect(self.remove_barset) self.button_layout.addWidget(self.remove_barset_button, 3, 0) self.align_button = QPushButton("Align (Bottom)") self.align_button.clicked.connect(self.set_legend_alignment) self.button_layout.addWidget(self.align_button, 4, 0) self.bold_button = QPushButton("Toggle bold") self.bold_button.clicked.connect(self.toggle_bold) self.button_layout.addWidget(self.bold_button, 8, 0) self.italic_button = QPushButton("Toggle italic") self.italic_button.clicked.connect(self.toggle_italic) self.button_layout.addWidget(self.italic_button, 9, 0) self.legend_posx.valueChanged.connect(self.update_legend_layout) self.legend_posy.valueChanged.connect(self.update_legend_layout) self.legend_width.valueChanged.connect(self.update_legend_layout) self.legend_height.valueChanged.connect(self.update_legend_layout) legend_layout = QFormLayout() legend_layout.addRow("HPos", self.legend_posx) legend_layout.addRow("VPos", self.legend_posy) legend_layout.addRow("Width", self.legend_width) legend_layout.addRow("Height", self.legend_height) self.legend_settings = QGroupBox("Detached legend") self.legend_settings.setLayout(legend_layout) self.button_layout.addWidget(self.legend_settings) self.legend_settings.setVisible(False) # Create chart view with the chart self.chart_view = QChartView(self.chart, self) # Create spinbox to modify font size self.font_size.setValue(self.chart.legend().font().pointSizeF()) self.font_size.valueChanged.connect(self.font_size_changed) self.font_layout.addRow("Legend font size", self.font_size) # Create layout for grid and detached legend self.main_layout.addLayout(self.button_layout, 0, 0) self.main_layout.addLayout(self.font_layout, 1, 0) self.main_layout.addWidget(self.chart_view, 0, 1, 3, 1) self.setLayout(self.main_layout) self.create_series()
class MainWidget(QWidget): def __init__(self, parent=None): super(MainWidget, self).__init__(parent) self.chart = QChart() self.series = QBarSeries() self.main_layout = QGridLayout() self.button_layout = QGridLayout() self.font_layout = QFormLayout() self.font_size = QDoubleSpinBox() self.legend_posx = QDoubleSpinBox() self.legend_posy = QDoubleSpinBox() self.legend_width = QDoubleSpinBox() self.legend_height = QDoubleSpinBox() self.detach_legend_button = QPushButton("Toggle attached") self.detach_legend_button.clicked.connect(self.toggle_attached) self.button_layout.addWidget(self.detach_legend_button, 0, 0) self.add_set_button = QPushButton("add barset") self.add_set_button.clicked.connect(self.add_barset) self.button_layout.addWidget(self.add_set_button, 2, 0) self.remove_barset_button = QPushButton("remove barset") self.remove_barset_button.clicked.connect(self.remove_barset) self.button_layout.addWidget(self.remove_barset_button, 3, 0) self.align_button = QPushButton("Align (Bottom)") self.align_button.clicked.connect(self.set_legend_alignment) self.button_layout.addWidget(self.align_button, 4, 0) self.bold_button = QPushButton("Toggle bold") self.bold_button.clicked.connect(self.toggle_bold) self.button_layout.addWidget(self.bold_button, 8, 0) self.italic_button = QPushButton("Toggle italic") self.italic_button.clicked.connect(self.toggle_italic) self.button_layout.addWidget(self.italic_button, 9, 0) self.legend_posx.valueChanged.connect(self.update_legend_layout) self.legend_posy.valueChanged.connect(self.update_legend_layout) self.legend_width.valueChanged.connect(self.update_legend_layout) self.legend_height.valueChanged.connect(self.update_legend_layout) legend_layout = QFormLayout() legend_layout.addRow("HPos", self.legend_posx) legend_layout.addRow("VPos", self.legend_posy) legend_layout.addRow("Width", self.legend_width) legend_layout.addRow("Height", self.legend_height) self.legend_settings = QGroupBox("Detached legend") self.legend_settings.setLayout(legend_layout) self.button_layout.addWidget(self.legend_settings) self.legend_settings.setVisible(False) # Create chart view with the chart self.chart_view = QChartView(self.chart, self) # Create spinbox to modify font size self.font_size.setValue(self.chart.legend().font().pointSizeF()) self.font_size.valueChanged.connect(self.font_size_changed) self.font_layout.addRow("Legend font size", self.font_size) # Create layout for grid and detached legend self.main_layout.addLayout(self.button_layout, 0, 0) self.main_layout.addLayout(self.font_layout, 1, 0) self.main_layout.addWidget(self.chart_view, 0, 1, 3, 1) self.setLayout(self.main_layout) self.create_series() def create_series(self): self.add_barset() self.add_barset() self.add_barset() self.add_barset() self.chart.addSeries(self.series) self.chart.setTitle("Legend detach example") self.chart.createDefaultAxes() self.chart.legend().setVisible(True) self.chart.legend().setAlignment(Qt.AlignBottom) self.chart_view.setRenderHint(QPainter.Antialiasing) def show_legend_spinbox(self): self.legend_settings.setVisible(True) chart_viewrect = self.chart_view.rect() self.legend_posx.setMinimum(0) self.legend_posx.setMaximum(chart_viewrect.width()) self.legend_posx.setValue(150) self.legend_posy.setMinimum(0) self.legend_posy.setMaximum(chart_viewrect.height()) self.legend_posy.setValue(150) self.legend_width.setMinimum(0) self.legend_width.setMaximum(chart_viewrect.width()) self.legend_width.setValue(150) self.legend_height.setMinimum(0) self.legend_height.setMaximum(chart_viewrect.height()) self.legend_height.setValue(75) def hideLegendSpinbox(self): self.legend_settings.setVisible(False) def toggle_attached(self): legend = self.chart.legend() if legend.isAttachedToChart(): legend.detachFromChart() legend.setBackgroundVisible(True) legend.setBrush(QBrush(QColor(128, 128, 128, 128))) legend.setPen(QPen(QColor(192, 192, 192, 192))) self.show_legend_spinbox() self.update_legend_layout() else: legend.attachToChart() legend.setBackgroundVisible(False) self.hideLegendSpinbox() self.update() def add_barset(self): series_count = self.series.count() bar_set = QBarSet(f"set {series_count}") delta = series_count * 0.1 bar_set.append([1 + delta, 2 + delta, 3 + delta, 4 + delta]) self.series.append(bar_set) def remove_barset(self): sets = self.series.barSets() len_sets = len(sets) if len_sets > 0: self.series.remove(sets[len_sets - 1]) def set_legend_alignment(self): button = self.sender() legend = self.chart.legend() alignment = legend.alignment() if alignment == Qt.AlignTop: legend.setAlignment(Qt.AlignLeft) if button: button.setText("Align (Left)") elif alignment == Qt.AlignLeft: legend.setAlignment(Qt.AlignBottom) if button: button.setText("Align (Bottom)") elif alignment == Qt.AlignBottom: legend.setAlignment(Qt.AlignRight) if button: button.setText("Align (Right)") else: if button: button.setText("Align (Top)") legend.setAlignment(Qt.AlignTop) def toggle_bold(self): legend = self.chart.legend() font = legend.font() font.setBold(not font.bold()) legend.setFont(font) def toggle_italic(self): legend = self.chart.legend() font = legend.font() font.setItalic(not font.italic()) legend.setFont(font) def font_size_changed(self): legend = self.chart.legend() font = legend.font() font_size = self.font_size.value() if font_size < 1: font_size = 1 font.setPointSizeF(font_size) legend.setFont(font) def update_legend_layout(self): legend = self.chart.legend() rect = QRectF(self.legend_posx.value(), self.legend_posy.value(), self.legend_width.value(), self.legend_height.value()) legend.setGeometry(rect) legend.update()
def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.setWindowModality(Qt.ApplicationModal) MainWindow.resize(1492, 1852) sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) MainWindow.setMinimumSize(QSize(700, 700)) MainWindow.setMaximumSize(QSize(16777215, 16777215)) MainWindow.setBaseSize(QSize(600, 600)) font = QFont() font.setPointSize(12) font.setKerning(True) MainWindow.setFont(font) MainWindow.setAutoFillBackground(False) MainWindow.setStyleSheet(u"") MainWindow.setDocumentMode(False) MainWindow.setTabShape(QTabWidget.Rounded) MainWindow.setDockOptions(QMainWindow.AllowTabbedDocks|QMainWindow.AnimatedDocks) MainWindow.setUnifiedTitleAndToolBarOnMac(False) self.action_Quit = QAction(MainWindow) self.action_Quit.setObjectName(u"action_Quit") self.main_widget = QWidget(MainWindow) self.main_widget.setObjectName(u"main_widget") self.main_widget.setEnabled(True) self.main_widget.setMinimumSize(QSize(650, 650)) self.main_widget.setContextMenuPolicy(Qt.DefaultContextMenu) self.main_widget.setAutoFillBackground(False) self.main_widget.setStyleSheet(u"") self.main_layout = QGridLayout(self.main_widget) self.main_layout.setObjectName(u"main_layout") self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.log_button = QPushButton(self.main_widget) self.log_button.setObjectName(u"log_button") sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.log_button.sizePolicy().hasHeightForWidth()) self.log_button.setSizePolicy(sizePolicy1) self.log_button.setMinimumSize(QSize(24, 24)) font1 = QFont() font1.setPointSize(9) font1.setBold(True) font1.setKerning(True) self.log_button.setFont(font1) self.log_button.setCursor(QCursor(Qt.PointingHandCursor)) self.log_button.setCheckable(False) self.log_button.setFlat(True) self.horizontalLayout_2.addWidget(self.log_button) self.main_layout.addLayout(self.horizontalLayout_2, 5, 2, 1, 1) self.shuttle_widget = QWidget(self.main_widget) self.shuttle_widget.setObjectName(u"shuttle_widget") self.shuttle_widget.setMinimumSize(QSize(600, 600)) self.shuttle_widget.setMaximumSize(QSize(600, 600)) self.shuttle_widget.setAutoFillBackground(False) self.shuttle_widget.setStyleSheet(u"QWidget#shuttle_widget {background: url(images/ShuttleXpress_Black.png);\n" " background-repeat:no-repeat;}\n" " ") self.button_1 = QCheckBox(self.shuttle_widget) self.button_1.setObjectName(u"button_1") self.button_1.setGeometry(QRect(80, 266, 24, 24)) sizePolicy1.setHeightForWidth(self.button_1.sizePolicy().hasHeightForWidth()) self.button_1.setSizePolicy(sizePolicy1) self.button_1.setMinimumSize(QSize(24, 24)) self.button_1.setFont(font) self.button_1.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.usb_status = QPushButton(self.shuttle_widget) self.usb_status.setObjectName(u"usb_status") self.usb_status.setEnabled(False) self.usb_status.setGeometry(QRect(288, 10, 24, 24)) sizePolicy1.setHeightForWidth(self.usb_status.sizePolicy().hasHeightForWidth()) self.usb_status.setSizePolicy(sizePolicy1) self.usb_status.setMinimumSize(QSize(24, 24)) self.usb_status.setFont(font1) self.usb_status.setCursor(QCursor(Qt.ArrowCursor)) self.usb_status.setAutoFillBackground(False) self.usb_status.setText(u"") icon = QIcon() icon.addFile(u"images/usb_black_24.png", QSize(), QIcon.Disabled, QIcon.Off) icon.addFile(u"images/usb_white_24.png", QSize(), QIcon.Disabled, QIcon.On) self.usb_status.setIcon(icon) self.usb_status.setIconSize(QSize(24, 24)) self.usb_status.setCheckable(True) self.usb_status.setChecked(False) self.usb_status.setFlat(True) self.button_5 = QCheckBox(self.shuttle_widget) self.button_5.setObjectName(u"button_5") self.button_5.setGeometry(QRect(498, 266, 24, 24)) sizePolicy1.setHeightForWidth(self.button_5.sizePolicy().hasHeightForWidth()) self.button_5.setSizePolicy(sizePolicy1) self.button_5.setMinimumSize(QSize(24, 24)) self.button_5.setFont(font) self.button_5.setLayoutDirection(Qt.RightToLeft) self.button_5.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_pos4 = QRadioButton(self.shuttle_widget) self.wheel_pos4.setObjectName(u"wheel_pos4") self.wheel_pos4.setGeometry(QRect(382, 164, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos4.sizePolicy().hasHeightForWidth()) self.wheel_pos4.setSizePolicy(sizePolicy1) self.wheel_pos4.setMinimumSize(QSize(24, 24)) self.wheel_pos4.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_cent0 = QRadioButton(self.shuttle_widget) self.wheel_cent0.setObjectName(u"wheel_cent0") self.wheel_cent0.setGeometry(QRect(289, 130, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_cent0.sizePolicy().hasHeightForWidth()) self.wheel_cent0.setSizePolicy(sizePolicy1) self.wheel_cent0.setMinimumSize(QSize(24, 24)) self.wheel_cent0.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_cent0.setChecked(True) self.wheel_pos1 = QRadioButton(self.shuttle_widget) self.wheel_pos1.setObjectName(u"wheel_pos1") self.wheel_pos1.setGeometry(QRect(314, 133, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos1.sizePolicy().hasHeightForWidth()) self.wheel_pos1.setSizePolicy(sizePolicy1) self.wheel_pos1.setMinimumSize(QSize(24, 24)) self.wheel_pos1.setStyleSheet(u"color: white;") self.wheel_pos2 = QRadioButton(self.shuttle_widget) self.wheel_pos2.setObjectName(u"wheel_pos2") self.wheel_pos2.setGeometry(QRect(338, 139, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos2.sizePolicy().hasHeightForWidth()) self.wheel_pos2.setSizePolicy(sizePolicy1) self.wheel_pos2.setMinimumSize(QSize(24, 24)) self.wheel_pos2.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.dial = QDial(self.shuttle_widget) self.dial.setObjectName(u"dial") self.dial.setGeometry(QRect(197, 178, 216, 216)) sizePolicy2 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth(self.dial.sizePolicy().hasHeightForWidth()) self.dial.setSizePolicy(sizePolicy2) self.dial.setMinimumSize(QSize(24, 24)) self.dial.setAutoFillBackground(False) self.dial.setStyleSheet(u"background-color: black;") self.dial.setMinimum(0) self.dial.setMaximum(10) self.dial.setPageStep(1) self.dial.setValue(5) self.dial.setSliderPosition(5) self.dial.setInvertedAppearance(False) self.dial.setInvertedControls(False) self.dial.setWrapping(True) self.dial.setNotchTarget(3.700000000000000) self.dial.setNotchesVisible(False) self.wheel_neg6 = QRadioButton(self.shuttle_widget) self.wheel_neg6.setObjectName(u"wheel_neg6") self.wheel_neg6.setGeometry(QRect(162, 204, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg6.sizePolicy().hasHeightForWidth()) self.wheel_neg6.setSizePolicy(sizePolicy1) self.wheel_neg6.setMinimumSize(QSize(24, 24)) self.wheel_neg6.setStyleSheet(u"color: white;") self.wheel_pos5 = QRadioButton(self.shuttle_widget) self.wheel_pos5.setObjectName(u"wheel_pos5") self.wheel_pos5.setGeometry(QRect(400, 182, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos5.sizePolicy().hasHeightForWidth()) self.wheel_pos5.setSizePolicy(sizePolicy1) self.wheel_pos5.setMinimumSize(QSize(24, 24)) self.wheel_pos5.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.button_2 = QCheckBox(self.shuttle_widget) self.button_2.setObjectName(u"button_2") self.button_2.setGeometry(QRect(156, 122, 24, 24)) sizePolicy1.setHeightForWidth(self.button_2.sizePolicy().hasHeightForWidth()) self.button_2.setSizePolicy(sizePolicy1) self.button_2.setMinimumSize(QSize(24, 24)) self.button_2.setFont(font) self.button_2.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_neg5 = QRadioButton(self.shuttle_widget) self.wheel_neg5.setObjectName(u"wheel_neg5") self.wheel_neg5.setGeometry(QRect(178, 182, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg5.sizePolicy().hasHeightForWidth()) self.wheel_neg5.setSizePolicy(sizePolicy1) self.wheel_neg5.setMinimumSize(QSize(24, 24)) self.wheel_neg5.setStyleSheet(u"color: white;") self.wheel_pos6 = QRadioButton(self.shuttle_widget) self.wheel_pos6.setObjectName(u"wheel_pos6") self.wheel_pos6.setGeometry(QRect(416, 204, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos6.sizePolicy().hasHeightForWidth()) self.wheel_pos6.setSizePolicy(sizePolicy1) self.wheel_pos6.setMinimumSize(QSize(24, 24)) self.wheel_pos6.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_neg1 = QRadioButton(self.shuttle_widget) self.wheel_neg1.setObjectName(u"wheel_neg1") self.wheel_neg1.setGeometry(QRect(264, 133, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg1.sizePolicy().hasHeightForWidth()) self.wheel_neg1.setSizePolicy(sizePolicy1) self.wheel_neg1.setMinimumSize(QSize(24, 24)) self.wheel_neg1.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.button_4 = QCheckBox(self.shuttle_widget) self.button_4.setObjectName(u"button_4") self.button_4.setGeometry(QRect(430, 122, 24, 24)) sizePolicy1.setHeightForWidth(self.button_4.sizePolicy().hasHeightForWidth()) self.button_4.setSizePolicy(sizePolicy1) self.button_4.setMinimumSize(QSize(24, 24)) self.button_4.setFont(font) self.button_4.setLayoutDirection(Qt.RightToLeft) self.button_4.setAutoFillBackground(False) self.button_4.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_pos7 = QRadioButton(self.shuttle_widget) self.wheel_pos7.setObjectName(u"wheel_pos7") self.wheel_pos7.setGeometry(QRect(427, 229, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos7.sizePolicy().hasHeightForWidth()) self.wheel_pos7.setSizePolicy(sizePolicy1) self.wheel_pos7.setMinimumSize(QSize(24, 24)) self.wheel_pos7.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.button_3 = QCheckBox(self.shuttle_widget) self.button_3.setObjectName(u"button_3") self.button_3.setGeometry(QRect(290, 72, 24, 24)) sizePolicy1.setHeightForWidth(self.button_3.sizePolicy().hasHeightForWidth()) self.button_3.setSizePolicy(sizePolicy1) self.button_3.setMinimumSize(QSize(24, 24)) self.button_3.setFont(font) self.button_3.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.button_3.setTristate(False) self.wheel_neg2 = QRadioButton(self.shuttle_widget) self.wheel_neg2.setObjectName(u"wheel_neg2") self.wheel_neg2.setGeometry(QRect(240, 139, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg2.sizePolicy().hasHeightForWidth()) self.wheel_neg2.setSizePolicy(sizePolicy1) self.wheel_neg2.setMinimumSize(QSize(24, 24)) self.wheel_neg2.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_pos3 = QRadioButton(self.shuttle_widget) self.wheel_pos3.setObjectName(u"wheel_pos3") self.wheel_pos3.setGeometry(QRect(361, 149, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_pos3.sizePolicy().hasHeightForWidth()) self.wheel_pos3.setSizePolicy(sizePolicy1) self.wheel_pos3.setMinimumSize(QSize(24, 24)) self.wheel_pos3.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_neg3 = QRadioButton(self.shuttle_widget) self.wheel_neg3.setObjectName(u"wheel_neg3") self.wheel_neg3.setGeometry(QRect(217, 149, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg3.sizePolicy().hasHeightForWidth()) self.wheel_neg3.setSizePolicy(sizePolicy1) self.wheel_neg3.setMinimumSize(QSize(24, 24)) self.wheel_neg3.setStyleSheet(u"color: white;") self.wheel_neg4 = QRadioButton(self.shuttle_widget) self.wheel_neg4.setObjectName(u"wheel_neg4") self.wheel_neg4.setGeometry(QRect(196, 164, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg4.sizePolicy().hasHeightForWidth()) self.wheel_neg4.setSizePolicy(sizePolicy1) self.wheel_neg4.setMinimumSize(QSize(24, 24)) self.wheel_neg4.setStyleSheet(u"background: #000000ff;\n" " color: white;\n" " ") self.wheel_neg7 = QRadioButton(self.shuttle_widget) self.wheel_neg7.setObjectName(u"wheel_neg7") self.wheel_neg7.setGeometry(QRect(151, 229, 24, 24)) sizePolicy1.setHeightForWidth(self.wheel_neg7.sizePolicy().hasHeightForWidth()) self.wheel_neg7.setSizePolicy(sizePolicy1) self.wheel_neg7.setMinimumSize(QSize(24, 24)) self.wheel_neg7.setStyleSheet(u"color: white;") self.dial.raise_() self.button_1.raise_() self.usb_status.raise_() self.button_5.raise_() self.wheel_pos4.raise_() self.wheel_cent0.raise_() self.wheel_pos1.raise_() self.wheel_pos2.raise_() self.wheel_neg6.raise_() self.wheel_pos5.raise_() self.button_2.raise_() self.wheel_neg5.raise_() self.wheel_pos6.raise_() self.wheel_neg1.raise_() self.button_4.raise_() self.wheel_pos7.raise_() self.button_3.raise_() self.wheel_neg2.raise_() self.wheel_pos3.raise_() self.wheel_neg3.raise_() self.wheel_neg4.raise_() self.wheel_neg7.raise_() self.main_layout.addWidget(self.shuttle_widget, 3, 2, 1, 1) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.about_button = QPushButton(self.main_widget) self.about_button.setObjectName(u"about_button") sizePolicy1.setHeightForWidth(self.about_button.sizePolicy().hasHeightForWidth()) self.about_button.setSizePolicy(sizePolicy1) self.about_button.setMinimumSize(QSize(24, 24)) self.about_button.setFont(font1) self.about_button.setCursor(QCursor(Qt.WhatsThisCursor)) self.about_button.setCheckable(False) self.about_button.setFlat(True) self.horizontalLayout.addWidget(self.about_button) self.main_layout.addLayout(self.horizontalLayout, 1, 2, 1, 1) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.plug_button = QPushButton(self.main_widget) self.plug_button.setObjectName(u"plug_button") sizePolicy1.setHeightForWidth(self.plug_button.sizePolicy().hasHeightForWidth()) self.plug_button.setSizePolicy(sizePolicy1) self.plug_button.setMinimumSize(QSize(24, 24)) self.plug_button.setFont(font1) self.plug_button.setCursor(QCursor(Qt.PointingHandCursor)) self.plug_button.setCheckable(False) self.plug_button.setFlat(True) self.horizontalLayout_3.addWidget(self.plug_button) self.main_layout.addLayout(self.horizontalLayout_3, 3, 1, 1, 1) self.verticalLayout = QVBoxLayout() self.verticalLayout.setObjectName(u"verticalLayout") self.conf_button = QPushButton(self.main_widget) self.conf_button.setObjectName(u"conf_button") sizePolicy1.setHeightForWidth(self.conf_button.sizePolicy().hasHeightForWidth()) self.conf_button.setSizePolicy(sizePolicy1) self.conf_button.setMinimumSize(QSize(24, 24)) self.conf_button.setFont(font1) self.conf_button.setCursor(QCursor(Qt.PointingHandCursor)) self.conf_button.setCheckable(False) self.conf_button.setFlat(True) self.verticalLayout.addWidget(self.conf_button) self.main_layout.addLayout(self.verticalLayout, 3, 4, 1, 1) MainWindow.setCentralWidget(self.main_widget) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName(u"statusbar") self.statusbar.setMinimumSize(QSize(600, 0)) MainWindow.setStatusBar(self.statusbar) self.about_widget = QDockWidget(MainWindow) self.about_widget.setObjectName(u"about_widget") self.about_widget.setEnabled(True) sizePolicy3 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth(self.about_widget.sizePolicy().hasHeightForWidth()) self.about_widget.setSizePolicy(sizePolicy3) self.about_widget.setMinimumSize(QSize(600, 600)) self.about_widget.setVisible(True) self.about_widget.setFloating(False) self.about_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetMovable) self.about_widget.setAllowedAreas(Qt.TopDockWidgetArea) self.about_layout = QWidget() self.about_layout.setObjectName(u"about_layout") sizePolicy3.setHeightForWidth(self.about_layout.sizePolicy().hasHeightForWidth()) self.about_layout.setSizePolicy(sizePolicy3) self.about_layout.setAutoFillBackground(False) self.gridLayout_3 = QGridLayout(self.about_layout) self.gridLayout_3.setObjectName(u"gridLayout_3") self.about_text = QTextEdit(self.about_layout) self.about_text.setObjectName(u"about_text") self.about_text.setFocusPolicy(Qt.WheelFocus) self.about_text.setAcceptDrops(False) self.about_text.setStyleSheet(u"color: white;") self.about_text.setFrameShape(QFrame.StyledPanel) self.about_text.setFrameShadow(QFrame.Sunken) self.about_text.setUndoRedoEnabled(False) self.about_text.setReadOnly(True) self.about_text.setAcceptRichText(True) self.gridLayout_3.addWidget(self.about_text, 0, 0, 1, 1) self.about_widget.setWidget(self.about_layout) MainWindow.addDockWidget(Qt.TopDockWidgetArea, self.about_widget) self.log_widget = QDockWidget(MainWindow) self.log_widget.setObjectName(u"log_widget") self.log_widget.setEnabled(True) self.log_widget.setMinimumSize(QSize(550, 158)) self.log_widget.setFont(font) self.log_widget.setVisible(True) self.log_widget.setFloating(False) self.log_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetFloatable|QDockWidget.DockWidgetMovable) self.log_widget.setAllowedAreas(Qt.BottomDockWidgetArea) self.log_layout = QWidget() self.log_layout.setObjectName(u"log_layout") sizePolicy4 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy4.setHorizontalStretch(0) sizePolicy4.setVerticalStretch(0) sizePolicy4.setHeightForWidth(self.log_layout.sizePolicy().hasHeightForWidth()) self.log_layout.setSizePolicy(sizePolicy4) self.gridLayout_2 = QGridLayout(self.log_layout) self.gridLayout_2.setObjectName(u"gridLayout_2") self.log_content_layout = QVBoxLayout() self.log_content_layout.setObjectName(u"log_content_layout") self.log_content_layout.setSizeConstraint(QLayout.SetDefaultConstraint) self.log_text = QPlainTextEdit(self.log_layout) self.log_text.setObjectName(u"log_text") sizePolicy4.setHeightForWidth(self.log_text.sizePolicy().hasHeightForWidth()) self.log_text.setSizePolicy(sizePolicy4) self.log_text.setMinimumSize(QSize(0, 0)) self.log_text.setAcceptDrops(False) self.log_text.setFrameShape(QFrame.StyledPanel) self.log_text.setFrameShadow(QFrame.Sunken) self.log_text.setUndoRedoEnabled(False) self.log_text.setReadOnly(True) self.log_content_layout.addWidget(self.log_text) self.buttons_layout = QHBoxLayout() self.buttons_layout.setObjectName(u"buttons_layout") self.buttons_layout.setSizeConstraint(QLayout.SetDefaultConstraint) self.log_clear_button = QToolButton(self.log_layout) self.log_clear_button.setObjectName(u"log_clear_button") icon1 = QIcon() icon1.addFile(u"images/delete-sweep_24.png", QSize(), QIcon.Normal, QIcon.Off) self.log_clear_button.setIcon(icon1) self.log_clear_button.setIconSize(QSize(24, 24)) self.buttons_layout.addWidget(self.log_clear_button) self.log_content_layout.addLayout(self.buttons_layout) self.gridLayout_2.addLayout(self.log_content_layout, 0, 0, 1, 1) self.log_widget.setWidget(self.log_layout) MainWindow.addDockWidget(Qt.BottomDockWidgetArea, self.log_widget) self.config_widget = QDockWidget(MainWindow) self.config_widget.setObjectName(u"config_widget") self.config_widget.setEnabled(True) self.config_widget.setMinimumSize(QSize(250, 600)) self.config_widget.setFloating(False) self.config_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetFloatable|QDockWidget.DockWidgetMovable) self.config_widget.setAllowedAreas(Qt.RightDockWidgetArea) self.config_layout = QWidget() self.config_layout.setObjectName(u"config_layout") self.gridLayout = QGridLayout(self.config_layout) self.gridLayout.setObjectName(u"gridLayout") self.config_content_layout = QFormLayout() self.config_content_layout.setObjectName(u"config_content_layout") self.gridLayout.addLayout(self.config_content_layout, 0, 0, 1, 1) self.config_widget.setWidget(self.config_layout) MainWindow.addDockWidget(Qt.RightDockWidgetArea, self.config_widget) self.plugins_widget = QDockWidget(MainWindow) self.plugins_widget.setObjectName(u"plugins_widget") self.plugins_widget.setMinimumSize(QSize(250, 600)) self.plugins_widget.setAllowedAreas(Qt.LeftDockWidgetArea) self.dockWidgetContents = QWidget() self.dockWidgetContents.setObjectName(u"dockWidgetContents") self.plugins_widget.setWidget(self.dockWidgetContents) MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.plugins_widget) self.about_widget.raise_() self.log_widget.raise_() self.retranslateUi(MainWindow) self.usb_status.setDefault(False) QMetaObject.connectSlotsByName(MainWindow)
def __init__(self) -> None: super().__init__() # member self.combobox_parameter1 = IM3536ParameterCombobox() self.combobox_parameter2 = IM3536ParameterCombobox() self.combobox_parameter3 = IM3536ParameterCombobox() self.combobox_parameter4 = IM3536ParameterCombobox() self.spinbox_measurements_num = QSpinBox() self.checkbox_parmanent = QCheckBox("Parmanent Measurement") self.checkbox_acquire_monitor_data = QCheckBox( "Acquire Voltage/Current Monitor Values") self.group_parameter = QGroupBox("Parameter") self.group_only_lcr = QGroupBox("Only LCR Meter Mode") self.group_option = QGroupBox("Option") # setup self.combobox_parameter1.setCurrentText( "Rs (Equivalent series resistance)") self.combobox_parameter1.set_none_disabled(True) self.spinbox_measurements_num.setRange(1, 1000000000) self.checkbox_acquire_monitor_data.setChecked(True) self.checkbox_parmanent.setChecked(True) self.spinbox_measurements_num.setEnabled(False) self.group_only_lcr.setEnabled(False) # stup layout f_layout_parameter = QFormLayout() f_layout_parameter.addRow("1", self.combobox_parameter1) f_layout_parameter.addRow("2", self.combobox_parameter2) f_layout_parameter.addRow("3", self.combobox_parameter3) f_layout_parameter.addRow("4", self.combobox_parameter4) self.group_parameter.setLayout(f_layout_parameter) f_layout_only_lcr = QFormLayout() f_layout_only_lcr.addRow(self.checkbox_parmanent) f_layout_only_lcr.addRow("Number of Measurements", self.spinbox_measurements_num) self.group_only_lcr.setLayout(f_layout_only_lcr) f_layout_option = QFormLayout() f_layout_option.addRow(self.checkbox_acquire_monitor_data) self.group_option.setLayout(f_layout_option) v_layout = AVBoxLayout(self) v_layout.addWidget(self.group_parameter) v_layout.addWidget(self.group_only_lcr) v_layout.addWidget(self.group_option)
def __init__(self) -> None: super().__init__() # member self.pathname_line = PathLine() self.checkbox_save_to_file = QCheckBox("Save to File") self.t_button_open_filedialog = create_tool_button( is_text_beside_icon=True) self.t_button_step_mode = create_tool_button(fixed_width=250) self.t_button_cycle_mode = create_tool_button(fixed_width=250) self.t_button_only_lcr_mode = create_tool_button(fixed_width=250) self.t_button_lcr_state = create_tool_button(fixed_width=250) self.spinbox_interval = QSpinBox() self.group_save = QGroupBox("Save") self.group_mode = QGroupBox("Mode") self.group_lcr_state = QGroupBox("LCR Meter") self.group_measure_interval = QGroupBox("Measurement Interval") # setup self.spinbox_interval.setRange(1, 100000) self.checkbox_save_to_file.setEnabled(False) # setup layout f_layout_save = QFormLayout() f_layout_save.addRow("File Path", self.pathname_line) f_layout_save.addWidget(self.t_button_open_filedialog) f_layout_save.addRow(self.checkbox_save_to_file) self.group_save.setLayout(f_layout_save) v_layout_mode = AVBoxLayout() v_layout_mode.addWidget(self.t_button_step_mode) v_layout_mode.addWidget(self.t_button_cycle_mode) v_layout_mode.addWidget(self.t_button_only_lcr_mode) v_layout_mode.setAlignment(Qt.AlignHCenter) self.group_mode.setLayout(v_layout_mode) v_layout_lcr_state = AVBoxLayout() v_layout_lcr_state.addWidget(self.t_button_lcr_state) v_layout_lcr_state.setAlignment(Qt.AlignHCenter) self.group_lcr_state.setLayout(v_layout_lcr_state) f_layout_repeat = QFormLayout() f_layout_repeat.addRow("Interval", add_unit(self.spinbox_interval, "msec")) self.group_measure_interval.setLayout(f_layout_repeat) v_layout = AVBoxLayout(self) v_layout.addWidget(self.group_save) v_layout.addWidget(self.group_mode) v_layout.addWidget(self.group_lcr_state) v_layout.addWidget(self.group_measure_interval)
def setupUi(self, EditRenderPreset_UI): if not EditRenderPreset_UI.objectName(): EditRenderPreset_UI.setObjectName(u"EditRenderPreset_UI") EditRenderPreset_UI.resize(463, 630) self.verticalLayout_2 = QVBoxLayout(EditRenderPreset_UI) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.mainBox = QHBoxLayout() self.mainBox.setObjectName(u"mainBox") self.formLayout_6 = QFormLayout() self.formLayout_6.setObjectName(u"formLayout_6") self.formLayout_6.setContentsMargins(-1, 20, 10, -1) self.groupLabel = QLabel(EditRenderPreset_UI) self.groupLabel.setObjectName(u"groupLabel") self.formLayout_6.setWidget(0, QFormLayout.LabelRole, self.groupLabel) self.presetNameLabel = QLabel(EditRenderPreset_UI) self.presetNameLabel.setObjectName(u"presetNameLabel") self.formLayout_6.setWidget(1, QFormLayout.LabelRole, self.presetNameLabel) self.preset_name = QLineEdit(EditRenderPreset_UI) self.preset_name.setObjectName(u"preset_name") self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.preset_name) self.label_2 = QLabel(EditRenderPreset_UI) self.label_2.setObjectName(u"label_2") self.formLayout_6.setWidget(2, QFormLayout.LabelRole, self.label_2) self.formatCombo = QComboBox(EditRenderPreset_UI) self.formatCombo.setObjectName(u"formatCombo") self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.formatCombo) self.tabWidget = QTabWidget(EditRenderPreset_UI) self.tabWidget.setObjectName(u"tabWidget") self.video_tab = QWidget() self.video_tab.setObjectName(u"video_tab") self.verticalLayout_3 = QVBoxLayout(self.video_tab) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.scrollArea = QScrollArea(self.video_tab) self.scrollArea.setObjectName(u"scrollArea") sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.scrollArea.sizePolicy().hasHeightForWidth()) self.scrollArea.setSizePolicy(sizePolicy) self.scrollArea.setFrameShape(QFrame.NoFrame) self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName( u"scrollAreaWidgetContents") self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 428, 650)) self.formLayout_3 = QFormLayout(self.scrollAreaWidgetContents) self.formLayout_3.setObjectName(u"formLayout_3") self.formLayout_3.setContentsMargins(-1, -1, 40, -1) self.label_4 = QLabel(self.scrollAreaWidgetContents) self.label_4.setObjectName(u"label_4") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.resWidth = QSpinBox(self.scrollAreaWidgetContents) self.resWidth.setObjectName(u"resWidth") self.resWidth.setMinimum(1) self.resWidth.setMaximum(8192) self.resWidth.setSingleStep(2) self.resWidth.setValue(1) self.horizontalLayout_3.addWidget(self.resWidth) self.label_9 = QLabel(self.scrollAreaWidgetContents) self.label_9.setObjectName(u"label_9") self.label_9.setMinimumSize(QSize(10, 0)) self.label_9.setText(u"x") self.label_9.setAlignment(Qt.AlignCenter) self.horizontalLayout_3.addWidget(self.label_9) self.resHeight = QSpinBox(self.scrollAreaWidgetContents) self.resHeight.setObjectName(u"resHeight") self.resHeight.setMinimum(1) self.resHeight.setMaximum(8192) self.resHeight.setSingleStep(2) self.horizontalLayout_3.addWidget(self.resHeight) self.linkResoultion = QToolButton(self.scrollAreaWidgetContents) self.linkResoultion.setObjectName(u"linkResoultion") icon = QIcon() iconThemeName = u"link" if QIcon.hasThemeIcon(iconThemeName): icon = QIcon.fromTheme(iconThemeName) else: icon.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) self.linkResoultion.setIcon(icon) self.linkResoultion.setCheckable(True) self.linkResoultion.setAutoRaise(True) self.horizontalLayout_3.addWidget(self.linkResoultion) self.formLayout_3.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_3) self.label_6 = QLabel(self.scrollAreaWidgetContents) self.label_6.setObjectName(u"label_6") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_6) self.parCombo = QComboBox(self.scrollAreaWidgetContents) self.parCombo.setObjectName(u"parCombo") self.parCombo.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.parCombo) self.label_16 = QLabel(self.scrollAreaWidgetContents) self.label_16.setObjectName(u"label_16") self.formLayout_3.setWidget(2, QFormLayout.LabelRole, self.label_16) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.displayAspectNum = QSpinBox(self.scrollAreaWidgetContents) self.displayAspectNum.setObjectName(u"displayAspectNum") self.displayAspectNum.setMinimum(1) self.displayAspectNum.setMaximum(8192) self.horizontalLayout_4.addWidget(self.displayAspectNum) self.label_17 = QLabel(self.scrollAreaWidgetContents) self.label_17.setObjectName(u"label_17") self.label_17.setMinimumSize(QSize(10, 0)) self.label_17.setText(u":") self.label_17.setAlignment(Qt.AlignCenter) self.horizontalLayout_4.addWidget(self.label_17) self.displayAspectDen = QSpinBox(self.scrollAreaWidgetContents) self.displayAspectDen.setObjectName(u"displayAspectDen") self.displayAspectDen.setMinimum(1) self.displayAspectDen.setMaximum(8192) self.horizontalLayout_4.addWidget(self.displayAspectDen) self.formLayout_3.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_4) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.framerateNum = QSpinBox(self.scrollAreaWidgetContents) self.framerateNum.setObjectName(u"framerateNum") self.framerateNum.setMinimum(1) self.framerateNum.setMaximum(1000000) self.horizontalLayout.addWidget(self.framerateNum) self.label_8 = QLabel(self.scrollAreaWidgetContents) self.label_8.setObjectName(u"label_8") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.label_8.sizePolicy().hasHeightForWidth()) self.label_8.setSizePolicy(sizePolicy1) self.label_8.setMinimumSize(QSize(10, 0)) self.label_8.setText(u"/") self.label_8.setAlignment(Qt.AlignCenter) self.horizontalLayout.addWidget(self.label_8) self.framerateDen = QSpinBox(self.scrollAreaWidgetContents) self.framerateDen.setObjectName(u"framerateDen") self.framerateDen.setMinimum(1) self.framerateDen.setMaximum(9999) self.horizontalLayout.addWidget(self.framerateDen) self.formLayout_3.setLayout(3, QFormLayout.FieldRole, self.horizontalLayout) self.label_3 = QLabel(self.scrollAreaWidgetContents) self.label_3.setObjectName(u"label_3") self.formLayout_3.setWidget(3, QFormLayout.LabelRole, self.label_3) self.label_22 = QLabel(self.scrollAreaWidgetContents) self.label_22.setObjectName(u"label_22") self.formLayout_3.setWidget(4, QFormLayout.LabelRole, self.label_22) self.frameRateDisplay = QLabel(self.scrollAreaWidgetContents) self.frameRateDisplay.setObjectName(u"frameRateDisplay") self.frameRateDisplay.setEnabled(True) self.formLayout_3.setWidget(4, QFormLayout.FieldRole, self.frameRateDisplay) self.label_7 = QLabel(self.scrollAreaWidgetContents) self.label_7.setObjectName(u"label_7") self.formLayout_3.setWidget(5, QFormLayout.LabelRole, self.label_7) self.scanningCombo = QComboBox(self.scrollAreaWidgetContents) self.scanningCombo.addItem("") self.scanningCombo.addItem("") self.scanningCombo.setObjectName(u"scanningCombo") self.formLayout_3.setWidget(5, QFormLayout.FieldRole, self.scanningCombo) self.fieldOrderLabel = QLabel(self.scrollAreaWidgetContents) self.fieldOrderLabel.setObjectName(u"fieldOrderLabel") self.formLayout_3.setWidget(6, QFormLayout.LabelRole, self.fieldOrderLabel) self.fieldOrderCombo = QComboBox(self.scrollAreaWidgetContents) self.fieldOrderCombo.addItem("") self.fieldOrderCombo.addItem("") self.fieldOrderCombo.setObjectName(u"fieldOrderCombo") self.fieldOrderCombo.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_3.setWidget(6, QFormLayout.FieldRole, self.fieldOrderCombo) self.colorspaceLabel = QLabel(self.scrollAreaWidgetContents) self.colorspaceLabel.setObjectName(u"colorspaceLabel") self.colorspaceLabel.setEnabled(False) self.formLayout_3.setWidget(7, QFormLayout.LabelRole, self.colorspaceLabel) self.colorspaceCombo = QComboBox(self.scrollAreaWidgetContents) self.colorspaceCombo.setObjectName(u"colorspaceCombo") self.colorspaceCombo.setEnabled(False) self.formLayout_3.setWidget(7, QFormLayout.FieldRole, self.colorspaceCombo) self.vCodecCombo = QComboBox(self.scrollAreaWidgetContents) self.vCodecCombo.setObjectName(u"vCodecCombo") sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.vCodecCombo.sizePolicy().hasHeightForWidth()) self.vCodecCombo.setSizePolicy(sizePolicy2) self.formLayout_3.setWidget(8, QFormLayout.FieldRole, self.vCodecCombo) self.vRateControlCombo = QComboBox(self.scrollAreaWidgetContents) self.vRateControlCombo.setObjectName(u"vRateControlCombo") sizePolicy2.setHeightForWidth( self.vRateControlCombo.sizePolicy().hasHeightForWidth()) self.vRateControlCombo.setSizePolicy(sizePolicy2) self.formLayout_3.setWidget(9, QFormLayout.FieldRole, self.vRateControlCombo) self.label_24 = QLabel(self.scrollAreaWidgetContents) self.label_24.setObjectName(u"label_24") self.formLayout_3.setWidget(8, QFormLayout.LabelRole, self.label_24) self.label_12 = QLabel(self.scrollAreaWidgetContents) self.label_12.setObjectName(u"label_12") self.formLayout_3.setWidget(9, QFormLayout.LabelRole, self.label_12) self.default_vbitrate_label = QLabel(self.scrollAreaWidgetContents) self.default_vbitrate_label.setObjectName(u"default_vbitrate_label") self.formLayout_3.setWidget(10, QFormLayout.LabelRole, self.default_vbitrate_label) self.default_vbitrate = QSpinBox(self.scrollAreaWidgetContents) self.default_vbitrate.setObjectName(u"default_vbitrate") self.default_vbitrate.setMaximum(500000) self.formLayout_3.setWidget(10, QFormLayout.FieldRole, self.default_vbitrate) self.vBuffer_label = QLabel(self.scrollAreaWidgetContents) self.vBuffer_label.setObjectName(u"vBuffer_label") self.formLayout_3.setWidget(11, QFormLayout.LabelRole, self.vBuffer_label) self.vBuffer = QSpinBox(self.scrollAreaWidgetContents) self.vBuffer.setObjectName(u"vBuffer") self.vBuffer.setMaximum(9999) self.formLayout_3.setWidget(11, QFormLayout.FieldRole, self.vBuffer) self.vquality_label = QLabel(self.scrollAreaWidgetContents) self.vquality_label.setObjectName(u"vquality_label") self.formLayout_3.setWidget(12, QFormLayout.LabelRole, self.vquality_label) self.default_vquality = QSpinBox(self.scrollAreaWidgetContents) self.default_vquality.setObjectName(u"default_vquality") self.default_vquality.setMaximum(500000) self.formLayout_3.setWidget(12, QFormLayout.FieldRole, self.default_vquality) self.label_26 = QLabel(self.scrollAreaWidgetContents) self.label_26.setObjectName(u"label_26") self.formLayout_3.setWidget(13, QFormLayout.LabelRole, self.label_26) self.gopSpinner = QSpinBox(self.scrollAreaWidgetContents) self.gopSpinner.setObjectName(u"gopSpinner") self.gopSpinner.setMaximum(999) self.gopSpinner.setSingleStep(1) self.formLayout_3.setWidget(13, QFormLayout.FieldRole, self.gopSpinner) self.fixedGop = QCheckBox(self.scrollAreaWidgetContents) self.fixedGop.setObjectName(u"fixedGop") self.fixedGop.setEnabled(False) self.formLayout_3.setWidget(14, QFormLayout.FieldRole, self.fixedGop) self.bFramesSpinner = QSpinBox(self.scrollAreaWidgetContents) self.bFramesSpinner.setObjectName(u"bFramesSpinner") self.bFramesSpinner.setEnabled(False) self.bFramesSpinner.setMinimum(-1) self.bFramesSpinner.setMaximum(8) self.bFramesSpinner.setValue(-1) self.formLayout_3.setWidget(15, QFormLayout.FieldRole, self.bFramesSpinner) self.bFramesLabel = QLabel(self.scrollAreaWidgetContents) self.bFramesLabel.setObjectName(u"bFramesLabel") self.formLayout_3.setWidget(15, QFormLayout.LabelRole, self.bFramesLabel) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout_3.addWidget(self.scrollArea) self.tabWidget.addTab(self.video_tab, "") self.audio_tab = QWidget() self.audio_tab.setObjectName(u"audio_tab") self.formLayout_2 = QFormLayout(self.audio_tab) self.formLayout_2.setObjectName(u"formLayout_2") self.label_15 = QLabel(self.audio_tab) self.label_15.setObjectName(u"label_15") self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label_15) self.audioChannels = QComboBox(self.audio_tab) self.audioChannels.setObjectName(u"audioChannels") self.formLayout_2.setWidget(0, QFormLayout.FieldRole, self.audioChannels) self.label_13 = QLabel(self.audio_tab) self.label_13.setObjectName(u"label_13") self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.label_13) self.aCodecCombo = QComboBox(self.audio_tab) self.aCodecCombo.setObjectName(u"aCodecCombo") self.formLayout_2.setWidget(1, QFormLayout.FieldRole, self.aCodecCombo) self.label_11 = QLabel(self.audio_tab) self.label_11.setObjectName(u"label_11") self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_11) self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.audioSampleRate = QComboBox(self.audio_tab) self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.setObjectName(u"audioSampleRate") self.audioSampleRate.setEditable(True) self.horizontalLayout_5.addWidget(self.audioSampleRate) self.label_20 = QLabel(self.audio_tab) self.label_20.setObjectName(u"label_20") self.horizontalLayout_5.addWidget(self.label_20) self.formLayout_2.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_5) self.label_14 = QLabel(self.audio_tab) self.label_14.setObjectName(u"label_14") self.formLayout_2.setWidget(3, QFormLayout.LabelRole, self.label_14) self.aRateControlCombo = QComboBox(self.audio_tab) self.aRateControlCombo.setObjectName(u"aRateControlCombo") self.formLayout_2.setWidget(3, QFormLayout.FieldRole, self.aRateControlCombo) self.label_18 = QLabel(self.audio_tab) self.label_18.setObjectName(u"label_18") self.formLayout_2.setWidget(4, QFormLayout.LabelRole, self.label_18) self.aBitrate = QSpinBox(self.audio_tab) self.aBitrate.setObjectName(u"aBitrate") self.aBitrate.setMaximum(500000) self.formLayout_2.setWidget(4, QFormLayout.FieldRole, self.aBitrate) self.label_19 = QLabel(self.audio_tab) self.label_19.setObjectName(u"label_19") self.formLayout_2.setWidget(5, QFormLayout.LabelRole, self.label_19) self.aQuality = QSpinBox(self.audio_tab) self.aQuality.setObjectName(u"aQuality") self.aQuality.setMaximum(500000) self.formLayout_2.setWidget(5, QFormLayout.FieldRole, self.aQuality) self.tabWidget.addTab(self.audio_tab, "") self.tab = QWidget() self.tab.setObjectName(u"tab") self.verticalLayout = QVBoxLayout(self.tab) self.verticalLayout.setObjectName(u"verticalLayout") self.speedsLabel = QLabel(self.tab) self.speedsLabel.setObjectName(u"speedsLabel") self.verticalLayout.addWidget(self.speedsLabel) self.speeds_list = QTextEdit(self.tab) self.speeds_list.setObjectName(u"speeds_list") self.speeds_list.setAcceptRichText(False) self.verticalLayout.addWidget(self.speeds_list) self.label = QLabel(self.tab) self.label.setObjectName(u"label") self.verticalLayout.addWidget(self.label) self.overrideParamsWarning = KMessageWidget(self.tab) self.overrideParamsWarning.setObjectName(u"overrideParamsWarning") self.overrideParamsWarning.setProperty("wordWrap", True) self.overrideParamsWarning.setProperty("closeButtonVisible", False) self.verticalLayout.addWidget(self.overrideParamsWarning) self.additionalParams = QPlainTextEdit(self.tab) self.additionalParams.setObjectName(u"additionalParams") self.verticalLayout.addWidget(self.additionalParams) self.parametersLabel = QLabel(self.tab) self.parametersLabel.setObjectName(u"parametersLabel") self.parametersLabel.setTextFormat(Qt.RichText) self.parametersLabel.setWordWrap(True) self.parametersLabel.setOpenExternalLinks(True) self.verticalLayout.addWidget(self.parametersLabel) self.tabWidget.addTab(self.tab, "") self.formLayout_6.setWidget(4, QFormLayout.SpanningRole, self.tabWidget) self.parameters = QTextEdit(EditRenderPreset_UI) self.parameters.setObjectName(u"parameters") self.parameters.setReadOnly(True) self.parameters.setAcceptRichText(False) self.formLayout_6.setWidget(5, QFormLayout.SpanningRole, self.parameters) self.groupName = QComboBox(EditRenderPreset_UI) self.groupName.setObjectName(u"groupName") sizePolicy2.setHeightForWidth( self.groupName.sizePolicy().hasHeightForWidth()) self.groupName.setSizePolicy(sizePolicy2) self.groupName.setEditable(True) self.groupName.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.groupName) self.mainBox.addLayout(self.formLayout_6) self.verticalLayout_2.addLayout(self.mainBox) self.buttonBox = QDialogButtonBox(EditRenderPreset_UI) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.verticalLayout_2.addWidget(self.buttonBox) self.retranslateUi(EditRenderPreset_UI) self.buttonBox.rejected.connect(EditRenderPreset_UI.reject) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(EditRenderPreset_UI)
class Ui_EditRenderPreset_UI(object): def setupUi(self, EditRenderPreset_UI): if not EditRenderPreset_UI.objectName(): EditRenderPreset_UI.setObjectName(u"EditRenderPreset_UI") EditRenderPreset_UI.resize(463, 630) self.verticalLayout_2 = QVBoxLayout(EditRenderPreset_UI) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.mainBox = QHBoxLayout() self.mainBox.setObjectName(u"mainBox") self.formLayout_6 = QFormLayout() self.formLayout_6.setObjectName(u"formLayout_6") self.formLayout_6.setContentsMargins(-1, 20, 10, -1) self.groupLabel = QLabel(EditRenderPreset_UI) self.groupLabel.setObjectName(u"groupLabel") self.formLayout_6.setWidget(0, QFormLayout.LabelRole, self.groupLabel) self.presetNameLabel = QLabel(EditRenderPreset_UI) self.presetNameLabel.setObjectName(u"presetNameLabel") self.formLayout_6.setWidget(1, QFormLayout.LabelRole, self.presetNameLabel) self.preset_name = QLineEdit(EditRenderPreset_UI) self.preset_name.setObjectName(u"preset_name") self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.preset_name) self.label_2 = QLabel(EditRenderPreset_UI) self.label_2.setObjectName(u"label_2") self.formLayout_6.setWidget(2, QFormLayout.LabelRole, self.label_2) self.formatCombo = QComboBox(EditRenderPreset_UI) self.formatCombo.setObjectName(u"formatCombo") self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.formatCombo) self.tabWidget = QTabWidget(EditRenderPreset_UI) self.tabWidget.setObjectName(u"tabWidget") self.video_tab = QWidget() self.video_tab.setObjectName(u"video_tab") self.verticalLayout_3 = QVBoxLayout(self.video_tab) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.scrollArea = QScrollArea(self.video_tab) self.scrollArea.setObjectName(u"scrollArea") sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.scrollArea.sizePolicy().hasHeightForWidth()) self.scrollArea.setSizePolicy(sizePolicy) self.scrollArea.setFrameShape(QFrame.NoFrame) self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName( u"scrollAreaWidgetContents") self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 428, 650)) self.formLayout_3 = QFormLayout(self.scrollAreaWidgetContents) self.formLayout_3.setObjectName(u"formLayout_3") self.formLayout_3.setContentsMargins(-1, -1, 40, -1) self.label_4 = QLabel(self.scrollAreaWidgetContents) self.label_4.setObjectName(u"label_4") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.resWidth = QSpinBox(self.scrollAreaWidgetContents) self.resWidth.setObjectName(u"resWidth") self.resWidth.setMinimum(1) self.resWidth.setMaximum(8192) self.resWidth.setSingleStep(2) self.resWidth.setValue(1) self.horizontalLayout_3.addWidget(self.resWidth) self.label_9 = QLabel(self.scrollAreaWidgetContents) self.label_9.setObjectName(u"label_9") self.label_9.setMinimumSize(QSize(10, 0)) self.label_9.setText(u"x") self.label_9.setAlignment(Qt.AlignCenter) self.horizontalLayout_3.addWidget(self.label_9) self.resHeight = QSpinBox(self.scrollAreaWidgetContents) self.resHeight.setObjectName(u"resHeight") self.resHeight.setMinimum(1) self.resHeight.setMaximum(8192) self.resHeight.setSingleStep(2) self.horizontalLayout_3.addWidget(self.resHeight) self.linkResoultion = QToolButton(self.scrollAreaWidgetContents) self.linkResoultion.setObjectName(u"linkResoultion") icon = QIcon() iconThemeName = u"link" if QIcon.hasThemeIcon(iconThemeName): icon = QIcon.fromTheme(iconThemeName) else: icon.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) self.linkResoultion.setIcon(icon) self.linkResoultion.setCheckable(True) self.linkResoultion.setAutoRaise(True) self.horizontalLayout_3.addWidget(self.linkResoultion) self.formLayout_3.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_3) self.label_6 = QLabel(self.scrollAreaWidgetContents) self.label_6.setObjectName(u"label_6") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_6) self.parCombo = QComboBox(self.scrollAreaWidgetContents) self.parCombo.setObjectName(u"parCombo") self.parCombo.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.parCombo) self.label_16 = QLabel(self.scrollAreaWidgetContents) self.label_16.setObjectName(u"label_16") self.formLayout_3.setWidget(2, QFormLayout.LabelRole, self.label_16) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.displayAspectNum = QSpinBox(self.scrollAreaWidgetContents) self.displayAspectNum.setObjectName(u"displayAspectNum") self.displayAspectNum.setMinimum(1) self.displayAspectNum.setMaximum(8192) self.horizontalLayout_4.addWidget(self.displayAspectNum) self.label_17 = QLabel(self.scrollAreaWidgetContents) self.label_17.setObjectName(u"label_17") self.label_17.setMinimumSize(QSize(10, 0)) self.label_17.setText(u":") self.label_17.setAlignment(Qt.AlignCenter) self.horizontalLayout_4.addWidget(self.label_17) self.displayAspectDen = QSpinBox(self.scrollAreaWidgetContents) self.displayAspectDen.setObjectName(u"displayAspectDen") self.displayAspectDen.setMinimum(1) self.displayAspectDen.setMaximum(8192) self.horizontalLayout_4.addWidget(self.displayAspectDen) self.formLayout_3.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_4) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.framerateNum = QSpinBox(self.scrollAreaWidgetContents) self.framerateNum.setObjectName(u"framerateNum") self.framerateNum.setMinimum(1) self.framerateNum.setMaximum(1000000) self.horizontalLayout.addWidget(self.framerateNum) self.label_8 = QLabel(self.scrollAreaWidgetContents) self.label_8.setObjectName(u"label_8") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.label_8.sizePolicy().hasHeightForWidth()) self.label_8.setSizePolicy(sizePolicy1) self.label_8.setMinimumSize(QSize(10, 0)) self.label_8.setText(u"/") self.label_8.setAlignment(Qt.AlignCenter) self.horizontalLayout.addWidget(self.label_8) self.framerateDen = QSpinBox(self.scrollAreaWidgetContents) self.framerateDen.setObjectName(u"framerateDen") self.framerateDen.setMinimum(1) self.framerateDen.setMaximum(9999) self.horizontalLayout.addWidget(self.framerateDen) self.formLayout_3.setLayout(3, QFormLayout.FieldRole, self.horizontalLayout) self.label_3 = QLabel(self.scrollAreaWidgetContents) self.label_3.setObjectName(u"label_3") self.formLayout_3.setWidget(3, QFormLayout.LabelRole, self.label_3) self.label_22 = QLabel(self.scrollAreaWidgetContents) self.label_22.setObjectName(u"label_22") self.formLayout_3.setWidget(4, QFormLayout.LabelRole, self.label_22) self.frameRateDisplay = QLabel(self.scrollAreaWidgetContents) self.frameRateDisplay.setObjectName(u"frameRateDisplay") self.frameRateDisplay.setEnabled(True) self.formLayout_3.setWidget(4, QFormLayout.FieldRole, self.frameRateDisplay) self.label_7 = QLabel(self.scrollAreaWidgetContents) self.label_7.setObjectName(u"label_7") self.formLayout_3.setWidget(5, QFormLayout.LabelRole, self.label_7) self.scanningCombo = QComboBox(self.scrollAreaWidgetContents) self.scanningCombo.addItem("") self.scanningCombo.addItem("") self.scanningCombo.setObjectName(u"scanningCombo") self.formLayout_3.setWidget(5, QFormLayout.FieldRole, self.scanningCombo) self.fieldOrderLabel = QLabel(self.scrollAreaWidgetContents) self.fieldOrderLabel.setObjectName(u"fieldOrderLabel") self.formLayout_3.setWidget(6, QFormLayout.LabelRole, self.fieldOrderLabel) self.fieldOrderCombo = QComboBox(self.scrollAreaWidgetContents) self.fieldOrderCombo.addItem("") self.fieldOrderCombo.addItem("") self.fieldOrderCombo.setObjectName(u"fieldOrderCombo") self.fieldOrderCombo.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_3.setWidget(6, QFormLayout.FieldRole, self.fieldOrderCombo) self.colorspaceLabel = QLabel(self.scrollAreaWidgetContents) self.colorspaceLabel.setObjectName(u"colorspaceLabel") self.colorspaceLabel.setEnabled(False) self.formLayout_3.setWidget(7, QFormLayout.LabelRole, self.colorspaceLabel) self.colorspaceCombo = QComboBox(self.scrollAreaWidgetContents) self.colorspaceCombo.setObjectName(u"colorspaceCombo") self.colorspaceCombo.setEnabled(False) self.formLayout_3.setWidget(7, QFormLayout.FieldRole, self.colorspaceCombo) self.vCodecCombo = QComboBox(self.scrollAreaWidgetContents) self.vCodecCombo.setObjectName(u"vCodecCombo") sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.vCodecCombo.sizePolicy().hasHeightForWidth()) self.vCodecCombo.setSizePolicy(sizePolicy2) self.formLayout_3.setWidget(8, QFormLayout.FieldRole, self.vCodecCombo) self.vRateControlCombo = QComboBox(self.scrollAreaWidgetContents) self.vRateControlCombo.setObjectName(u"vRateControlCombo") sizePolicy2.setHeightForWidth( self.vRateControlCombo.sizePolicy().hasHeightForWidth()) self.vRateControlCombo.setSizePolicy(sizePolicy2) self.formLayout_3.setWidget(9, QFormLayout.FieldRole, self.vRateControlCombo) self.label_24 = QLabel(self.scrollAreaWidgetContents) self.label_24.setObjectName(u"label_24") self.formLayout_3.setWidget(8, QFormLayout.LabelRole, self.label_24) self.label_12 = QLabel(self.scrollAreaWidgetContents) self.label_12.setObjectName(u"label_12") self.formLayout_3.setWidget(9, QFormLayout.LabelRole, self.label_12) self.default_vbitrate_label = QLabel(self.scrollAreaWidgetContents) self.default_vbitrate_label.setObjectName(u"default_vbitrate_label") self.formLayout_3.setWidget(10, QFormLayout.LabelRole, self.default_vbitrate_label) self.default_vbitrate = QSpinBox(self.scrollAreaWidgetContents) self.default_vbitrate.setObjectName(u"default_vbitrate") self.default_vbitrate.setMaximum(500000) self.formLayout_3.setWidget(10, QFormLayout.FieldRole, self.default_vbitrate) self.vBuffer_label = QLabel(self.scrollAreaWidgetContents) self.vBuffer_label.setObjectName(u"vBuffer_label") self.formLayout_3.setWidget(11, QFormLayout.LabelRole, self.vBuffer_label) self.vBuffer = QSpinBox(self.scrollAreaWidgetContents) self.vBuffer.setObjectName(u"vBuffer") self.vBuffer.setMaximum(9999) self.formLayout_3.setWidget(11, QFormLayout.FieldRole, self.vBuffer) self.vquality_label = QLabel(self.scrollAreaWidgetContents) self.vquality_label.setObjectName(u"vquality_label") self.formLayout_3.setWidget(12, QFormLayout.LabelRole, self.vquality_label) self.default_vquality = QSpinBox(self.scrollAreaWidgetContents) self.default_vquality.setObjectName(u"default_vquality") self.default_vquality.setMaximum(500000) self.formLayout_3.setWidget(12, QFormLayout.FieldRole, self.default_vquality) self.label_26 = QLabel(self.scrollAreaWidgetContents) self.label_26.setObjectName(u"label_26") self.formLayout_3.setWidget(13, QFormLayout.LabelRole, self.label_26) self.gopSpinner = QSpinBox(self.scrollAreaWidgetContents) self.gopSpinner.setObjectName(u"gopSpinner") self.gopSpinner.setMaximum(999) self.gopSpinner.setSingleStep(1) self.formLayout_3.setWidget(13, QFormLayout.FieldRole, self.gopSpinner) self.fixedGop = QCheckBox(self.scrollAreaWidgetContents) self.fixedGop.setObjectName(u"fixedGop") self.fixedGop.setEnabled(False) self.formLayout_3.setWidget(14, QFormLayout.FieldRole, self.fixedGop) self.bFramesSpinner = QSpinBox(self.scrollAreaWidgetContents) self.bFramesSpinner.setObjectName(u"bFramesSpinner") self.bFramesSpinner.setEnabled(False) self.bFramesSpinner.setMinimum(-1) self.bFramesSpinner.setMaximum(8) self.bFramesSpinner.setValue(-1) self.formLayout_3.setWidget(15, QFormLayout.FieldRole, self.bFramesSpinner) self.bFramesLabel = QLabel(self.scrollAreaWidgetContents) self.bFramesLabel.setObjectName(u"bFramesLabel") self.formLayout_3.setWidget(15, QFormLayout.LabelRole, self.bFramesLabel) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout_3.addWidget(self.scrollArea) self.tabWidget.addTab(self.video_tab, "") self.audio_tab = QWidget() self.audio_tab.setObjectName(u"audio_tab") self.formLayout_2 = QFormLayout(self.audio_tab) self.formLayout_2.setObjectName(u"formLayout_2") self.label_15 = QLabel(self.audio_tab) self.label_15.setObjectName(u"label_15") self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label_15) self.audioChannels = QComboBox(self.audio_tab) self.audioChannels.setObjectName(u"audioChannels") self.formLayout_2.setWidget(0, QFormLayout.FieldRole, self.audioChannels) self.label_13 = QLabel(self.audio_tab) self.label_13.setObjectName(u"label_13") self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.label_13) self.aCodecCombo = QComboBox(self.audio_tab) self.aCodecCombo.setObjectName(u"aCodecCombo") self.formLayout_2.setWidget(1, QFormLayout.FieldRole, self.aCodecCombo) self.label_11 = QLabel(self.audio_tab) self.label_11.setObjectName(u"label_11") self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_11) self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.audioSampleRate = QComboBox(self.audio_tab) self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.setObjectName(u"audioSampleRate") self.audioSampleRate.setEditable(True) self.horizontalLayout_5.addWidget(self.audioSampleRate) self.label_20 = QLabel(self.audio_tab) self.label_20.setObjectName(u"label_20") self.horizontalLayout_5.addWidget(self.label_20) self.formLayout_2.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_5) self.label_14 = QLabel(self.audio_tab) self.label_14.setObjectName(u"label_14") self.formLayout_2.setWidget(3, QFormLayout.LabelRole, self.label_14) self.aRateControlCombo = QComboBox(self.audio_tab) self.aRateControlCombo.setObjectName(u"aRateControlCombo") self.formLayout_2.setWidget(3, QFormLayout.FieldRole, self.aRateControlCombo) self.label_18 = QLabel(self.audio_tab) self.label_18.setObjectName(u"label_18") self.formLayout_2.setWidget(4, QFormLayout.LabelRole, self.label_18) self.aBitrate = QSpinBox(self.audio_tab) self.aBitrate.setObjectName(u"aBitrate") self.aBitrate.setMaximum(500000) self.formLayout_2.setWidget(4, QFormLayout.FieldRole, self.aBitrate) self.label_19 = QLabel(self.audio_tab) self.label_19.setObjectName(u"label_19") self.formLayout_2.setWidget(5, QFormLayout.LabelRole, self.label_19) self.aQuality = QSpinBox(self.audio_tab) self.aQuality.setObjectName(u"aQuality") self.aQuality.setMaximum(500000) self.formLayout_2.setWidget(5, QFormLayout.FieldRole, self.aQuality) self.tabWidget.addTab(self.audio_tab, "") self.tab = QWidget() self.tab.setObjectName(u"tab") self.verticalLayout = QVBoxLayout(self.tab) self.verticalLayout.setObjectName(u"verticalLayout") self.speedsLabel = QLabel(self.tab) self.speedsLabel.setObjectName(u"speedsLabel") self.verticalLayout.addWidget(self.speedsLabel) self.speeds_list = QTextEdit(self.tab) self.speeds_list.setObjectName(u"speeds_list") self.speeds_list.setAcceptRichText(False) self.verticalLayout.addWidget(self.speeds_list) self.label = QLabel(self.tab) self.label.setObjectName(u"label") self.verticalLayout.addWidget(self.label) self.overrideParamsWarning = KMessageWidget(self.tab) self.overrideParamsWarning.setObjectName(u"overrideParamsWarning") self.overrideParamsWarning.setProperty("wordWrap", True) self.overrideParamsWarning.setProperty("closeButtonVisible", False) self.verticalLayout.addWidget(self.overrideParamsWarning) self.additionalParams = QPlainTextEdit(self.tab) self.additionalParams.setObjectName(u"additionalParams") self.verticalLayout.addWidget(self.additionalParams) self.parametersLabel = QLabel(self.tab) self.parametersLabel.setObjectName(u"parametersLabel") self.parametersLabel.setTextFormat(Qt.RichText) self.parametersLabel.setWordWrap(True) self.parametersLabel.setOpenExternalLinks(True) self.verticalLayout.addWidget(self.parametersLabel) self.tabWidget.addTab(self.tab, "") self.formLayout_6.setWidget(4, QFormLayout.SpanningRole, self.tabWidget) self.parameters = QTextEdit(EditRenderPreset_UI) self.parameters.setObjectName(u"parameters") self.parameters.setReadOnly(True) self.parameters.setAcceptRichText(False) self.formLayout_6.setWidget(5, QFormLayout.SpanningRole, self.parameters) self.groupName = QComboBox(EditRenderPreset_UI) self.groupName.setObjectName(u"groupName") sizePolicy2.setHeightForWidth( self.groupName.sizePolicy().hasHeightForWidth()) self.groupName.setSizePolicy(sizePolicy2) self.groupName.setEditable(True) self.groupName.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.groupName) self.mainBox.addLayout(self.formLayout_6) self.verticalLayout_2.addLayout(self.mainBox) self.buttonBox = QDialogButtonBox(EditRenderPreset_UI) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.verticalLayout_2.addWidget(self.buttonBox) self.retranslateUi(EditRenderPreset_UI) self.buttonBox.rejected.connect(EditRenderPreset_UI.reject) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(EditRenderPreset_UI) # setupUi def retranslateUi(self, EditRenderPreset_UI): EditRenderPreset_UI.setWindowTitle( QCoreApplication.translate("EditRenderPreset_UI", u"Save Render Preset", None)) self.groupLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Group:", None)) self.presetNameLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Preset name:", None)) self.label_2.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Container:", None)) self.label_4.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Resolution:", None)) self.linkResoultion.setText( QCoreApplication.translate("EditRenderPreset_UI", u"...", None)) self.label_6.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Pixel Aspect Ratio:", None)) self.label_16.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Display Aspect Ratio:", None)) self.label_3.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Frame Rate:", None)) self.label_22.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Fields per Second:", None)) self.frameRateDisplay.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Placeholder", None)) self.label_7.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Scanning:", None)) self.scanningCombo.setItemText( 0, QCoreApplication.translate("EditRenderPreset_UI", u"Interlaced", None)) self.scanningCombo.setItemText( 1, QCoreApplication.translate("EditRenderPreset_UI", u"Progressive", None)) self.fieldOrderLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Field Order:", None)) self.fieldOrderCombo.setItemText( 0, QCoreApplication.translate("EditRenderPreset_UI", u"Bottom Field First", None)) self.fieldOrderCombo.setItemText( 1, QCoreApplication.translate("EditRenderPreset_UI", u"Top Field First", None)) self.colorspaceLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Colorspace:", None)) self.label_24.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Codec:", None)) self.label_12.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Rate Control:", None)) self.default_vbitrate_label.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Bitrate:", None)) self.default_vbitrate.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u"k", None)) self.vBuffer_label.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Buffer Size:", None)) self.vBuffer.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u" KiB", None)) self.vquality_label.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Quality:", None)) #if QT_CONFIG(tooltip) self.label_26.setToolTip( QCoreApplication.translate("EditRenderPreset_UI", u"GOP = Group of Pictures", None)) #endif // QT_CONFIG(tooltip) self.label_26.setText( QCoreApplication.translate("EditRenderPreset_UI", u"GOP:", None)) self.gopSpinner.setSpecialValueText( QCoreApplication.translate("EditRenderPreset_UI", u"Auto", None)) self.gopSpinner.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u" frame(s)", None)) #if QT_CONFIG(tooltip) self.fixedGop.setToolTip( QCoreApplication.translate( "EditRenderPreset_UI", u"A fixed GOP means that keyframes will not be inserted at detected scene changes.", None)) #endif // QT_CONFIG(tooltip) self.fixedGop.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Fixed", None)) self.bFramesSpinner.setSpecialValueText( QCoreApplication.translate("EditRenderPreset_UI", u"Auto", None)) self.bFramesSpinner.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u" frame(s)", None)) self.bFramesLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"B Frames:", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.video_tab), QCoreApplication.translate("EditRenderPreset_UI", u"Video", None)) self.label_15.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Channels:", None)) self.label_13.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Codec:", None)) self.label_11.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Sample Rate:", None)) self.audioSampleRate.setItemText( 0, QCoreApplication.translate("EditRenderPreset_UI", u"8000", None)) self.audioSampleRate.setItemText( 1, QCoreApplication.translate("EditRenderPreset_UI", u"12000", None)) self.audioSampleRate.setItemText( 2, QCoreApplication.translate("EditRenderPreset_UI", u"16000", None)) self.audioSampleRate.setItemText( 3, QCoreApplication.translate("EditRenderPreset_UI", u"22050", None)) self.audioSampleRate.setItemText( 4, QCoreApplication.translate("EditRenderPreset_UI", u"32000", None)) self.audioSampleRate.setItemText( 5, QCoreApplication.translate("EditRenderPreset_UI", u"44100", None)) self.audioSampleRate.setItemText( 6, QCoreApplication.translate("EditRenderPreset_UI", u"48000", None)) self.audioSampleRate.setItemText( 7, QCoreApplication.translate("EditRenderPreset_UI", u"96000", None)) self.label_20.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Hz", None)) self.label_14.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Rate Control:", None)) self.label_18.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Bitrate:", None)) self.aBitrate.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u"k", None)) self.label_19.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Quality:", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.audio_tab), QCoreApplication.translate("EditRenderPreset_UI", u"Audio", None)) self.speedsLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Speed options:", None)) #if QT_CONFIG(tooltip) self.speeds_list.setToolTip( QCoreApplication.translate( "EditRenderPreset_UI", u"One line of options per speedup step, from slowest to fastest", None)) #endif // QT_CONFIG(tooltip) self.label.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Additional Parameters:", None)) self.parametersLabel.setText( QCoreApplication.translate( "EditRenderPreset_UI", u"<html><head/><body><p>See <a href=\"https://www.mltframework.org/plugins/ConsumerAvformat/\"><span style=\" text-decoration: underline; color:#2980b9;\">MLT documentation</span></a> for reference.</p></body></html>", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab), QCoreApplication.translate("EditRenderPreset_UI", u"Other", None))