def create_data_group(self): """Creates group for holding specific choice data selection""" button_group = QButtonGroup(self) button_group.setExclusive(True) colecao_radio_button = QRadioButton('Coleção') self.partidas_radio_button = QRadioButton('Partidas') colecao_radio_button.setChecked(True) button_group.addButton(colecao_radio_button) button_group.addButton(self.partidas_radio_button) (self.min_date_picker, min_date_label) = create_date_picker('À Partir de:', self) (self.max_date_picker, max_date_label) = create_date_picker('Até:', self) self.min_date_picker.dateChanged.connect( self.max_date_picker.setMinimumDate) colecao_radio_button.toggled.connect(self.min_date_picker.setDisabled) colecao_radio_button.toggled.connect(self.max_date_picker.setDisabled) self.map_users_button = QPushButton( 'Ver mapa de usuarios BGG -> Ludopedia', self) self.map_users_button.setEnabled(False) self.map_users_button.clicked.connect(self.user_map) colecao_radio_button.toggled.connect(self.map_users_button.setDisabled) group_box = QGroupBox('Dados') grid_layout = QGridLayout(group_box) grid_layout.addWidget(colecao_radio_button, 1, 1) grid_layout.addWidget(self.partidas_radio_button, 1, 2) grid_layout.addWidget(min_date_label, 2, 1) grid_layout.addWidget(self.min_date_picker, 2, 2) grid_layout.addWidget(max_date_label, 3, 1) grid_layout.addWidget(self.max_date_picker, 3, 2) grid_layout.addWidget(self.map_users_button, 4, 1, 1, 2) group_box.setLayout(grid_layout) return group_box
def setup_ui(self): super(SettingUI, self).setup_ui() max_width_label = QLabel(text="最大宽度", alignment=QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) max_width_combo = QComboBox() max_width_combo.addItems(Globals.max_width_arr) max_width_combo.setCurrentIndex(self.max_width_index) max_width_combo.currentIndexChanged.connect(self.on_combo_changed) size_label = QLabel(text="输出字号", alignment=QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) size_spin = QSpinBox() size_spin.setRange(10, 64) size_spin.setValue(Globals.config.get(Globals.UserData.font_size)) size_spin.valueChanged.connect(self.on_save_font_size) output_name_label = QLabel(text="输出名称", alignment=QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) output_name_edit = QLineEdit( Globals.config.get(Globals.UserData.font_save_name)) output_name_edit.textEdited.connect(self.on_output_name_edited) output_label = QLabel(text="输出目录", alignment=QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) output_line_edit = QLineEdit( Globals.config.get(Globals.UserData.output_dir)) output_line_edit.setReadOnly(True) output_line_edit.cursorPositionChanged.connect( self.on_output_choose_clicked) mode_1_radio = QRadioButton("图集模式") mode_2_radio = QRadioButton("字体模式") mode_1_radio.setChecked(True) mode_1_radio.toggled.connect(self.on_mode_1_radio_toggled) mode_radio_group = QButtonGroup(self) mode_radio_group.addButton(mode_1_radio, 0) mode_radio_group.addButton(mode_2_radio, 1) self.main_layout.setColumnStretch(1, 1) self.main_layout.setColumnStretch(3, 1) self.main_layout.addWidget(mode_1_radio, 0, 0, 1, 1) self.main_layout.addWidget(mode_2_radio, 0, 1, 1, 1) self.main_layout.addWidget(output_name_label, 1, 0, 1, 1) self.main_layout.addWidget(output_name_edit, 1, 1, 1, 1) self.main_layout.addWidget(max_width_label, 1, 2, 1, 1) self.main_layout.addWidget(max_width_combo, 1, 3, 1, 1) self.main_layout.addWidget(output_label, 2, 0, 1, 1) self.main_layout.addWidget(output_line_edit, 2, 1, 1, 1) self.main_layout.addWidget(size_label, 2, 2, 1, 1) self.main_layout.addWidget(size_spin, 2, 3, 1, 1) self.max_width_combo = max_width_combo self.size_spin = size_spin self.output_name_edit = output_name_edit self.output_line_edit = output_line_edit
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 test_text(pixmap_differ: PixmapDiffer): actual: QPainter expected: QPainter with pixmap_differ.create_painters( 300, 240, 'scaled_radio_button_text') as (actual, expected): ex_widget = QWidget() ex_layout = QVBoxLayout(ex_widget) ex_radio1 = QRadioButton('Lorem ipsum') ex_radio2 = QRadioButton('Lorem ipsum') ex_font = ex_radio1.font() if ex_font.family() == 'Sans Serif': # Fonts are different on GitHub actions. big_font_size = 27 small_font_size = 27 ex_radio1.setStyleSheet('QRadioButton::indicator {width: 27} ' 'QRadioButton {spacing: 13}') ex_radio2.setStyleSheet('QRadioButton::indicator {width: 27} ' 'QRadioButton {spacing: 13}') else: big_font_size = 29 small_font_size = 28 ex_radio1.setStyleSheet('QRadioButton::indicator {width: 29} ' 'QRadioButton {spacing: 14}') ex_radio2.setStyleSheet('QRadioButton::indicator {width: 28} ' 'QRadioButton {spacing: 14}') ex_font.setPointSize(big_font_size) ex_radio1.setFont(ex_font) ex_font.setPointSize(small_font_size) ex_radio2.setFont(ex_font) ex_size_policy = QSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) ex_radio1.setSizePolicy(ex_size_policy) ex_radio2.setSizePolicy(ex_size_policy) ex_layout.addWidget(ex_radio1) ex_layout.addWidget(ex_radio2) ex_layout.setStretch(0, 4) ex_layout.setStretch(1, 1) ex_widget.resize(300, 240) expected.drawPixmap(0, 0, ex_widget.grab()) widget = QWidget() layout = QVBoxLayout(widget) radio1 = ScaledRadioButton('Lorem ipsum') radio2 = ScaledRadioButton('Lorem ipsum') size_policy = QSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) radio1.setSizePolicy(size_policy) radio2.setSizePolicy(size_policy) layout.addWidget(radio1) layout.addWidget(radio2) layout.setStretch(0, 4) layout.setStretch(1, 1) widget.resize(300, 240) actual.drawPixmap(0, 0, widget.grab())
def setup_ui(self): super(FontUI, self).setup_ui() sys_radio = QRadioButton("系统字体") sys_radio.setChecked(True) font_combo = QComboBox() for item in self.system_fonts: font_combo.addItem(item[1]) font_combo.setCurrentIndex(0) font_combo.currentIndexChanged.connect(self.refresh_font) custom_radio = QRadioButton("自选字体") custom_radio.setCheckable(True) custom_radio.setChecked(False) custom_radio.toggled.connect(self.on_custom_radio_toggled) custom_edit = QLineEdit() custom_edit.setPlaceholderText("自定义字体(*.ttf, *.otf)") custom_edit.setReadOnly(True) custom_edit.setEnabled(False) custom_btn = QPushButton(text="浏览") custom_btn.setEnabled(False) custom_btn.clicked.connect(self.on_custom_clicked) font_group = QButtonGroup(self) font_group.addButton(sys_radio, 0) font_group.addButton(custom_radio, 1) font_group.setExclusive(True) input_label = QLabel("输出字符") input_edit = MLineEdit() import_btn = QPushButton(text="从文本文件导入") import_btn.clicked.connect(self.on_import_btn_clicked) self.main_layout.setColumnStretch(1, 1) self.main_layout.addWidget(sys_radio, 1, 0, 1, 1) self.main_layout.addWidget(font_combo, 1, 1, 1, 2) self.main_layout.addWidget(custom_radio, 2, 0, 1, 1) self.main_layout.addWidget(custom_edit, 2, 1, 1, 1) self.main_layout.addWidget(custom_btn, 2, 2, 1, 1) self.main_layout.addWidget(input_label, 3, 0, 1, 1) self.main_layout.addWidget(import_btn, 3, 2, 1, 1) self.main_layout.addWidget(input_edit, 4, 0, 1, 3) self.input_edit = input_edit self.font_combo = font_combo self.custom_btn = custom_btn self.custom_edit = custom_edit self.refresh_font()
def on_select_area(self, select_node: Optional[Node] = None): for node in self.radio_button_to_node.keys(): node.deleteLater() self.radio_button_to_node.clear() current_area = self.current_area self.area_view_canvas.select_area(current_area) if not current_area: self.new_node_button.setEnabled(False) self.delete_node_button.setEnabled(False) return is_first = True for node in sorted(current_area.nodes, key=lambda x: x.name): if node.is_derived_node: continue button = QRadioButton(self.nodes_scroll_contents) button.setText(node.name) self.radio_button_to_node[button] = node if is_first or select_node is node: self.selected_node_button = button button.setChecked(True) else: button.setChecked(False) button.toggled.connect(self.on_select_node) is_first = False self.nodes_scroll_layout.addWidget(button) self.new_node_button.setEnabled(True) self.delete_node_button.setEnabled(len(current_area.nodes) > 1) self.update_selected_node()
def __init__(self, parent=None): super(Maker, self).__init__(parent) self.setWindowTitle("Project Maker") self.userFilepath = QLineEdit() self.userFilepath.setPlaceholderText("Your filepath here...") self.projName = QLineEdit() self.projName.setPlaceholderText("Your project name here...") self.makeButton = QPushButton("Create Project") self.fileSearchButton = QPushButton("...") self.fileSearchButton.setToolTip( "Search for a directory for your project") self.goProj = QRadioButton("Go Project") self.goProj.setToolTip("You will still need a go.mod file") self.pyProj = QRadioButton("Python Project") self.versionControlFiles = QCheckBox( "Create README.md and .gitignore?") self.versionControlFiles.setToolTip( "Creates the files used in online version control, such as Github") self.pyProj.setChecked(True) self.versionControlFiles.setChecked(True) projSelect = QGroupBox("Project Selection") projectOptions = QVBoxLayout() projectOptions.addWidget(self.pyProj) projectOptions.addWidget(self.goProj) projectOptions.addWidget(self.versionControlFiles) projectOptions.stretch(1) projSelect.setLayout(projectOptions) searchLayout = QHBoxLayout() searchLayout.addWidget(self.userFilepath) searchLayout.addWidget(self.fileSearchButton) searchLayout.stretch(1) layout = QVBoxLayout() layout.addLayout(searchLayout) layout.addWidget(self.projName) layout.addWidget(self.makeButton) layout.addWidget(self.fileSearchButton) layout.addWidget(projSelect) self.setLayout(layout) self.makeButton.clicked.connect(self.createFiles) self.fileSearchButton.clicked.connect(self.onClickFileSearch)
def __init__(self, parent=None): super(ApiSelectionWidget, self).__init__(parent) self.api_900_1000: QRadioButton = QRadioButton() self.api_900_1000.setText("API 900 and 1000") self.api_900: QRadioButton = QRadioButton() self.api_900.setText("API 900") self.api_1000: QRadioButton = QRadioButton() self.api_1000.setText("API 1000") self.api_900_1000.setChecked(True) layout: QHBoxLayout = QHBoxLayout() layout.addWidget(self.api_900_1000) layout.addWidget(self.api_900) layout.addWidget(self.api_1000) self.setLayout(layout)
def __init__(self, parent): super().__init__(parent) self.setWindowTitle("Set reference") vbox = QVBoxLayout(self) grid = QGridLayout() self.average = QRadioButton("Average") self.channels = QRadioButton("Channel(s):") self.average.toggled.connect(self.toggle) self.channellist = QLineEdit() self.channellist.setEnabled(False) self.average.setChecked(True) grid.addWidget(self.average, 0, 0) grid.addWidget(self.channels, 1, 0) grid.addWidget(self.channellist, 1, 1) vbox.addLayout(grid) buttonbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) vbox.addWidget(buttonbox) buttonbox.accepted.connect(self.accept) buttonbox.rejected.connect(self.reject) vbox.setSizeConstraint(QVBoxLayout.SetFixedSize)
def __init__(self): super(PrePickerDialog, self).__init__() self.resize(250, 150) # Label self.label = QLabel(self) self.label.setObjectName(u"label") self.label.setLineWidth(1) self.label.setTextFormat(Qt.RichText) # Radio Buttons self.radioButton = QRadioButton(self) self.radioButton.setObjectName(u"radioButton") self.radioButton.toggle() self.radioButton_2 = QRadioButton(self) self.radioButton_2.setObjectName(u"radioButton_2") # Buttons buttons = QDialogButtonBox.Ok | QDialogButtonBox.Cancel self.buttonBox = QDialogButtonBox(buttons) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) # HBoxes self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.horizontalLayout_2.addWidget(self.radioButton) self.horizontalLayout_2.addWidget(self.radioButton_2) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalLayout.addWidget(self.buttonBox) # VBox for whole content self.verticalLayout = QVBoxLayout(self) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.addWidget(self.label) self.verticalLayout.addLayout(self.horizontalLayout_2) self.verticalLayout.addLayout(self.horizontalLayout) # Texts self.text_ui()
def __init__(self, model: SettingsModel, parent=None): super(SetPolicyWidget, self).__init__(parent) self._model = model self.setAccessibleName("InfoBox") self.titolo = QLabel("Politica di gestione conflitti") self.titolo.setAccessibleName('Title2') self.sottotitolo = QLabel("Cambia come vengono gestiti conflitti") self.sottotitolo.setAccessibleName('Sottotitolo') self.spaceLabel = QLabel(" ") self.client = QRadioButton( "Client: le modifiche in locale sovrascrivono quelle presenti nel server" ) self.manual = QRadioButton( "Manuale: verranno salvati entrambi i file, sarà l'utente a decidere cosa mantenere" ) self.Sl_model_changed() layout = QVBoxLayout() layout.addWidget(self.titolo) layout.addWidget(self.sottotitolo) layout.addWidget(self.spaceLabel) sub_layout = QVBoxLayout() sub_layout.addWidget(self.client) sub_layout.addWidget(self.manual) layout.addLayout(sub_layout) self.setLayout(layout) self.client.clicked.connect(self.Sl_client_checked) self.manual.clicked.connect(self.Sl_manual_checked)
def initUI(self): lcd = QLCDNumber(self) sld = QSlider(Qt.Horizontal, self) is_binary = QRadioButton("is binary?", self) vbox = QVBoxLayout() vbox.addWidget(lcd) vbox.addWidget(sld) vbox.addWidget(is_binary) self.setLayout(vbox) # sld.setRange(0, 10) sld.setMaximum(1000) sld.setMinimum(-100) sld.valueChanged.connect(lcd.display) is_binary.toggled.connect(self.switch_binary) self.setGeometry(300, 300, 250, 150) self.setWindowTitle('EXample 6') self.show()
def load_pet_ct(self, roi_color=None, iso_color=None, slice_view="axial", format_metadata=True): """ Loads the PET/CT GUI after data has been added to PTCTDictContainer """ self.pt_ct_dict_container = PTCTDictContainer() self.iso_color = iso_color self.zoom = 1 self.current_slice_number = None self.slice_view = slice_view self.overlay_view = slice_view self.display_metadata = False self.format_metadata = format_metadata self.dicom_view_layout = QtWidgets.QHBoxLayout() self.radio_button_layout = QtWidgets.QHBoxLayout() self.slider_layout = QtWidgets.QHBoxLayout() # self.radio_button_layout.setAlignment(QtCore.Qt.AlignCenter) # Create components self.slider = QtWidgets.QSlider(QtCore.Qt.Vertical) self.init_slider() self.view = QtWidgets.QGraphicsView() # Alpha slider self.alpha_slider = QtWidgets.QSlider(QtCore.Qt.Horizontal) self.init_alpha_slider() # Slider labels self.ct_label = QtWidgets.QLabel("CT") self.pt_label = QtWidgets.QLabel("PET") self.init_view() self.scene = QtWidgets.QGraphicsScene() # radio buttons self.coronal_button = QRadioButton("Coronal") self.coronal_button.setChecked(False) self.coronal_button.toggled.connect(self.update_axis) self.axial_button = QRadioButton("Axial") self.axial_button.setChecked(True) self.axial_button.toggled.connect(self.update_axis) self.sagittal_button = QRadioButton("Sagittal") self.sagittal_button.setChecked(False) self.sagittal_button.toggled.connect(self.update_axis) # Set layout self.dicom_view_layout.addWidget(self.view) self.dicom_view_layout.addWidget(self.slider) self.slider_layout.addWidget(self.ct_label) self.slider_layout.addWidget(self.alpha_slider) self.slider_layout.addWidget(self.pt_label) self.load_pet_ct_button.setVisible(False) self.pet_ct_view_layout.removeWidget(self.load_pet_ct_button) self.pet_ct_view_layout.addLayout(self.dicom_view_layout) self.pet_ct_view_layout.addLayout(self.slider_layout) self.pet_ct_view_layout.addLayout(self.radio_button_layout, QtCore.Qt.AlignBottom | QtCore.Qt.AlignCenter) self.radio_button_layout.addWidget(self.coronal_button) self.radio_button_layout.addWidget(self.axial_button) self.radio_button_layout.addWidget(self.sagittal_button) self.setLayout(self.pet_ct_view_layout) self.update_view() self.initialised = True
def __init__(self) -> None: QMainWindow.__init__(self) self.setSizePolicy( QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)) self.setMaximumSize(QSize(1920, 1080)) self.setStyleSheet("padding: 0px; margin: 0px;") self.setIconSize(QSize(32, 32)) self.setWindowTitle("BossyBot 2000 - Image Tagger") self.setWindowIcon(self.load_icon(icon)) self.menubar = QMenuBar(self) self.menubar.setSizePolicy(EXP_MAX) self.menubar.setMaximumSize(QSize(INFINITE, 30)) self.menu_file = QMenu('File', self.menubar) self.menu_options = QMenu('Options', self.menubar) self.menu_help = QMenu('Help', self.menubar) self.menubar.addAction(self.menu_file.menuAction()) self.menubar.addAction(self.menu_options.menuAction()) self.menubar.addAction(self.menu_help.menuAction()) self.open = QAction('Open', self) self.menu_file.addAction(self.open) self.open.triggered.connect(self.open_file) self.exit_button = QAction('Exit', self) self.exit_button.triggered.connect(lambda: sys.exit(0), Qt.QueuedConnection) self.menu_file.addAction(self.exit_button) self.setMenuBar(self.menubar) self.previous_button = QAction(self.load_icon(previous), '<<', self) self.next_button = QAction(self.load_icon(next_icon), '>>', self) self.rotate_left_button = QAction(self.load_icon(left), '', self) self.rotate_right_button = QAction(self.load_icon(right), '', self) self.play_button = QAction(self.load_icon(play), '', self) self.play_button.setCheckable(True) self.delete_button = QAction(self.load_icon(delete), '', self) self.reload_button = QAction(self.load_icon(reload), '', self) self.mirror_button = QAction('Mirror', self) self.actual_size_button = QAction('Actual Size', self) self.browser_button = QAction('Browser', self) self.browser_button.setCheckable(True) self.browser_button.setChecked(True) self.crop_button = QAction('Crop', self) self.crop_button.setCheckable(True) self.toolbuttons = { self.rotate_left_button: { 'shortcut': ',', 'connect': lambda: self.pixmap.setRotation(self.pixmap.rotation() - 90) }, self.rotate_right_button: { 'shortcut': '.', 'connect': lambda: self.pixmap.setRotation(self.pixmap.rotation() + 90) }, self.delete_button: { 'shortcut': 'Del', 'connect': self.delete }, self.previous_button: { 'shortcut': 'Left', 'connect': self.previous }, self.play_button: { 'shortcut': 'Space', 'connect': self.play }, self.next_button: { 'shortcut': 'Right', 'connect': self.next }, self.reload_button: { 'shortcut': 'F5', 'connect': self.reload } } self.toolbar = QToolBar(self) self.toolbar.setSizePolicy(EXP_MAX) self.toolbar.setMaximumSize(QSize(INFINITE, 27)) for _ in (self.browser_button, self.crop_button, self.mirror_button, self.actual_size_button): self.toolbar.addAction(_) self.addToolBar(Qt.TopToolBarArea, self.toolbar) for button in self.toolbuttons: button.setShortcut(self.toolbuttons[button]['shortcut']) button.triggered.connect(self.toolbuttons[button]['connect']) self.toolbar.addAction(button) self.centralwidget = QWidget(self) self.centralwidget.setSizePolicy(EXP_EXP) self.setCentralWidget(self.centralwidget) self.grid = QGridLayout(self.centralwidget) self.media = QGraphicsScene(self) self.media.setItemIndexMethod(QGraphicsScene.NoIndex) self.media.setBackgroundBrush(QBrush(Qt.black)) self.view = MyView(self.media, self) self.view.setSizePolicy(EXP_EXP) self.media.setSceneRect(0, 0, self.view.width(), self.view.height()) self.grid.addWidget(self.view, 0, 0, 1, 1) self.frame = QFrame(self.centralwidget) self.frame.setSizePolicy( QSizePolicy(QSizePolicy.Fixed, QSizePolicy.MinimumExpanding)) self.frame.setMinimumSize(QSize(325, 500)) self.frame.setStyleSheet( "QFrame { border: 4px inset #222; border-radius: 10; }") self.layout_widget = QWidget(self.frame) self.layout_widget.setGeometry(QRect(0, 400, 321, 91)) self.layout_widget.setContentsMargins(15, 15, 15, 15) self.grid2 = QGridLayout(self.layout_widget) self.grid2.setContentsMargins(0, 0, 0, 0) self.save_button = QPushButton('Yes (Save)', self.layout_widget) self.save_button.setSizePolicy(FIX_FIX) self.save_button.setMaximumSize(QSize(120, 26)) self.save_button.setVisible(False) self.grid2.addWidget(self.save_button, 1, 0, 1, 1) self.no_save_button = QPushButton('No (Reload)', self.layout_widget) self.no_save_button.setSizePolicy(FIX_FIX) self.no_save_button.setMaximumSize(QSize(120, 26)) self.no_save_button.setVisible(False) self.grid2.addWidget(self.no_save_button, 1, 1, 1, 1) self.label = QLabel("Current image modified, save it?", self.layout_widget) self.label.setSizePolicy(FIX_FIX) self.label.setMaximumSize(QSize(325, 60)) self.label.setVisible(False) self.label.setAlignment(Qt.AlignCenter) self.grid2.addWidget(self.label, 0, 0, 1, 2) self.layout_widget = QWidget(self.frame) self.layout_widget.setGeometry(QRect(0, 0, 321, 213)) self.ass = QRadioButton('Ass', self.layout_widget) self.ass_exposed = QRadioButton('Ass (exposed)', self.layout_widget) self.ass_reset = QRadioButton(self.frame) self.ass_group = QButtonGroup(self) self.breasts = QRadioButton('Breasts', self.layout_widget) self.breasts_exposed = QRadioButton('Breasts (exposed)', self.layout_widget) self.breasts_reset = QRadioButton(self.frame) self.breasts_group = QButtonGroup(self) self.pussy = QRadioButton('Pussy', self.layout_widget) self.pussy_exposed = QRadioButton('Pussy (exposed)', self.layout_widget) self.pussy_reset = QRadioButton(self.frame) self.pussy_group = QButtonGroup(self) self.fully_clothed = QRadioButton('Fully Clothed', self.layout_widget) self.fully_nude = QRadioButton('Fully Nude', self.layout_widget) self.nudity_reset = QRadioButton(self.frame) self.nudity = QButtonGroup(self) self.smiling = QRadioButton('Smiling', self.layout_widget) self.glaring = QRadioButton('Glaring', self.layout_widget) self.expression_reset = QRadioButton(self.frame) self.expression = QButtonGroup(self) self.grid3 = QGridLayout(self.layout_widget) self.grid3.setVerticalSpacing(15) self.grid3.setContentsMargins(0, 15, 0, 0) self.radios = { self.ass: { 'this': 'ass', 'that': 'ass_exposed', 'group': self.ass_group, 'reset': self.ass_reset, 'grid': (0, 0, 1, 1) }, self.ass_exposed: { 'this': 'ass_exposed', 'that': 'ass', 'group': self.ass_group, 'reset': self.ass_reset, 'grid': (0, 1, 1, 1) }, self.breasts: { 'this': 'breasts', 'that': 'breasts_exposed', 'group': self.breasts_group, 'reset': self.breasts_reset, 'grid': (1, 0, 1, 1) }, self.breasts_exposed: { 'this': 'breasts_exposed', 'that': 'breasts', 'group': self.breasts_group, 'reset': self.breasts_reset, 'grid': (1, 1, 1, 1) }, self.pussy: { 'this': 'pussy', 'that': 'pussy_exposed', 'group': self.pussy_group, 'reset': self.pussy_reset, 'grid': (2, 0, 1, 1) }, self.pussy_exposed: { 'this': 'pussy_exposed', 'that': 'pussy', 'group': self.pussy_group, 'reset': self.pussy_reset, 'grid': (2, 1, 1, 1) }, self.fully_clothed: { 'this': 'fully_clothed', 'that': 'fully_nude', 'group': self.nudity, 'reset': self.nudity_reset, 'grid': (3, 0, 1, 1) }, self.fully_nude: { 'this': 'fully_nude', 'that': 'fully_clothed', 'group': self.nudity, 'reset': self.nudity_reset, 'grid': (3, 1, 1, 1) }, self.smiling: { 'this': 'smiling', 'that': 'glaring', 'group': self.expression, 'reset': self.expression_reset, 'grid': (4, 0, 1, 1) }, self.glaring: { 'this': 'glaring', 'that': 'smiling', 'group': self.expression, 'reset': self.expression_reset, 'grid': (4, 1, 1, 1) }, } for radio in self.radios: radio.setSizePolicy(FIX_FIX) radio.setMaximumSize(QSize(150, 22)) self.radios[radio]['reset'].setGeometry(QRect(0, 0, 0, 0)) self.grid3.addWidget(radio, *self.radios[radio]['grid']) if self.radios[radio]['group'] != self.nudity: radio.toggled.connect( lambda x=_, y=radio: self.annotate(self.radios[y]['this'])) self.radios[radio]['group'].addButton(radio) self.radios[radio]['group'].addButton(self.radios[radio]['reset']) self.save_tags_button = QPushButton('Save Tags', self.layout_widget) self.save_tags_button.setSizePolicy(FIX_FIX) self.save_tags_button.setMaximumSize(QSize(120, 26)) self.grid3.addWidget(self.save_tags_button, 5, 1, 1, 1) self.grid.addWidget(self.frame, 0, 1, 1, 1) self.browse_bar = QLabel(self.centralwidget) self.browse_bar.setSizePolicy(EXP_FIX) self.browse_bar.setMinimumSize(QSize(0, 100)) self.browse_bar.setMaximumSize(QSize(INFINITE, 100)) self.browse_bar.setStyleSheet("background: #000;") self.browse_bar.setAlignment(Qt.AlignCenter) self.h_box2 = QHBoxLayout(self.browse_bar) self.h_box2.setContentsMargins(4, 0, 0, 0) self.grid.addWidget(self.browse_bar, 1, 0, 1, 2) hiders = [ self.no_save_button.clicked, self.save_button.clicked, self.reload_button.triggered ] for hider in hiders: hider.connect(self.save_button.hide) hider.connect(self.no_save_button.hide) hider.connect(self.label.hide) showers = [ self.mirror_button.triggered, self.rotate_right_button.triggered, self.rotate_left_button.triggered ] for shower in showers: shower.connect(self.save_button.show) shower.connect(self.no_save_button.show) shower.connect(self.label.show) self.no_save_button.clicked.connect(self.reload) self.browser_button.toggled.connect(self.browse_bar.setVisible) self.play_button.toggled.connect(lambda: self.frame.setVisible( (True, False)[self.frame.isVisible()])) self.reload_button.triggered.connect(self.reload) self.mirror_button.triggered.connect(lambda: self.pixmap.setScale(-1)) self.save_button.clicked.connect(self.save_image) self.play_button.toggled.connect( lambda: self.browser_button.setChecked( (True, False)[self.browse_bar.isVisible()])) self.crop_button.toggled.connect(self.view.reset) self.actual_size_button.triggered.connect(self.actual_size) self.browser_button.triggered.connect(self.browser) self.save_tags_button.clicked.connect(self.save_tags) self.view.got_rect.connect(self.set_rect) self.crop_rect = QRect(QPoint(0, 0), QSize(0, 0)) self.dir_now = os.getcwd() self.files = [] self.index = 0 self.refresh_files() self.pixmap_is_scaled = False self.pixmap = QGraphicsPixmapItem() self.active_tag = '' self.reset_browser = False self.txt = PngInfo()
def test_icon(pixmap_differ: PixmapDiffer): actual: QPainter expected: QPainter with pixmap_differ.create_painters( 300, 240, 'scaled_radio_button_icon') as (actual, expected): display = TicTacToeDisplay() icon = display.player1_icon display.close() ex_widget = QWidget() ex_layout = QVBoxLayout(ex_widget) ex_radio1 = QRadioButton() ex_radio2 = QRadioButton('Lorem ipsum') ex_radio1.setIcon(icon) ex_radio2.setIcon(icon) ex_font = ex_radio1.font() if ex_font.family() == 'Sans Serif': # Fonts are different on GitHub actions. big_font_size = 93 small_font_size = 23 ex_radio1.setStyleSheet('QRadioButton::indicator {width: 93} ' 'QRadioButton {spacing: 46}') ex_radio2.setStyleSheet('QRadioButton::indicator {width: 23} ' 'QRadioButton {spacing: 11}') else: big_font_size = 93 small_font_size = 25 ex_radio1.setStyleSheet('QRadioButton::indicator {width: 93} ' 'QRadioButton {spacing: 46}') ex_radio2.setStyleSheet('QRadioButton::indicator {width: 25} ' 'QRadioButton {spacing: 12}') ex_radio1.setIconSize( QSize(big_font_size * 3 // 2, big_font_size * 3 // 2)) ex_radio2.setIconSize( QSize(small_font_size * 3 // 2, small_font_size * 3 // 2)) ex_font.setPointSize(big_font_size) ex_radio1.setFont(ex_font) ex_font.setPointSize(small_font_size) ex_radio2.setFont(ex_font) ex_size_policy = QSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) ex_radio1.setSizePolicy(ex_size_policy) ex_radio2.setSizePolicy(ex_size_policy) ex_layout.addWidget(ex_radio1) ex_layout.addWidget(ex_radio2) ex_layout.setStretch(0, 4) ex_layout.setStretch(1, 1) ex_widget.resize(300, 240) expected.drawPixmap(0, 0, ex_widget.grab()) widget = QWidget() layout = QVBoxLayout(widget) radio1 = ScaledRadioButton() radio2 = ScaledRadioButton('Lorem ipsum') radio1.setIcon(icon) radio2.setIcon(icon) size_policy = QSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) radio1.setSizePolicy(size_policy) radio2.setSizePolicy(size_policy) layout.addWidget(radio1) layout.addWidget(radio2) layout.setStretch(0, 4) layout.setStretch(1, 1) widget.resize(300, 240) actual.drawPixmap(0, 0, widget.grab())
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 setupUi(self, SlideshowClip_UI): if not SlideshowClip_UI.objectName(): SlideshowClip_UI.setObjectName(u"SlideshowClip_UI") SlideshowClip_UI.resize(354, 631) self.gridLayout_4 = QGridLayout(SlideshowClip_UI) self.gridLayout_4.setObjectName(u"gridLayout_4") self.gridLayout_4.setVerticalSpacing(6) self.icon_list = QListWidget(SlideshowClip_UI) self.icon_list.setObjectName(u"icon_list") self.gridLayout_4.addWidget(self.icon_list, 12, 0, 1, 4) self.animation = KComboBox(SlideshowClip_UI) self.animation.setObjectName(u"animation") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.animation.sizePolicy().hasHeightForWidth()) self.animation.setSizePolicy(sizePolicy) self.gridLayout_4.addWidget(self.animation, 10, 2, 1, 2) self.slide_crop = QCheckBox(SlideshowClip_UI) self.slide_crop.setObjectName(u"slide_crop") self.gridLayout_4.addWidget(self.slide_crop, 4, 0, 1, 2) self.label_3 = QLabel(SlideshowClip_UI) self.label_3.setObjectName(u"label_3") self.gridLayout_4.addWidget(self.label_3, 0, 0, 1, 1) self.label_2 = QLabel(SlideshowClip_UI) self.label_2.setObjectName(u"label_2") self.gridLayout_4.addWidget(self.label_2, 2, 0, 1, 2) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.clip_duration = QLineEdit(SlideshowClip_UI) self.clip_duration.setObjectName(u"clip_duration") self.horizontalLayout_2.addWidget(self.clip_duration) self.clip_duration_frames = QSpinBox(SlideshowClip_UI) self.clip_duration_frames.setObjectName(u"clip_duration_frames") sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.clip_duration_frames.sizePolicy().hasHeightForWidth()) self.clip_duration_frames.setSizePolicy(sizePolicy1) self.clip_duration_frames.setMinimum(1) self.clip_duration_frames.setMaximum(256000) self.horizontalLayout_2.addWidget(self.clip_duration_frames) self.gridLayout_4.addLayout(self.horizontalLayout_2, 2, 2, 1, 1) self.luma_softness = QSlider(SlideshowClip_UI) self.luma_softness.setObjectName(u"luma_softness") self.luma_softness.setEnabled(False) self.luma_softness.setMaximum(100) self.luma_softness.setOrientation(Qt.Horizontal) self.gridLayout_4.addWidget(self.luma_softness, 8, 2, 1, 2) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.luma_duration = QLineEdit(SlideshowClip_UI) self.luma_duration.setObjectName(u"luma_duration") self.horizontalLayout.addWidget(self.luma_duration) self.luma_duration_frames = QSpinBox(SlideshowClip_UI) self.luma_duration_frames.setObjectName(u"luma_duration_frames") self.luma_duration_frames.setEnabled(False) sizePolicy1.setHeightForWidth( self.luma_duration_frames.sizePolicy().hasHeightForWidth()) self.luma_duration_frames.setSizePolicy(sizePolicy1) self.luma_duration_frames.setMinimum(1) self.luma_duration_frames.setMaximum(256000) self.horizontalLayout.addWidget(self.luma_duration_frames) self.gridLayout_4.addLayout(self.horizontalLayout, 5, 2, 1, 2) self.luma_fade = QCheckBox(SlideshowClip_UI) self.luma_fade.setObjectName(u"luma_fade") self.luma_fade.setEnabled(False) self.gridLayout_4.addWidget(self.luma_fade, 7, 0, 1, 1) self.slide_fade = QCheckBox(SlideshowClip_UI) self.slide_fade.setObjectName(u"slide_fade") self.gridLayout_4.addWidget(self.slide_fade, 5, 0, 1, 1) self.luma_file = KComboBox(SlideshowClip_UI) self.luma_file.setObjectName(u"luma_file") self.luma_file.setEnabled(False) self.gridLayout_4.addWidget(self.luma_file, 7, 2, 1, 2) self.label_softness = QLabel(SlideshowClip_UI) self.label_softness.setObjectName(u"label_softness") self.label_softness.setEnabled(False) self.gridLayout_4.addWidget(self.label_softness, 8, 0, 1, 1) self.groupBox = QGroupBox(SlideshowClip_UI) self.groupBox.setObjectName(u"groupBox") self.gridLayout = QGridLayout(self.groupBox) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setVerticalSpacing(0) self.method_mime = QRadioButton(self.groupBox) self.method_mime.setObjectName(u"method_mime") self.method_mime.setChecked(True) self.gridLayout.addWidget(self.method_mime, 0, 0, 1, 1) self.method_pattern = QRadioButton(self.groupBox) self.method_pattern.setObjectName(u"method_pattern") self.gridLayout.addWidget(self.method_pattern, 0, 1, 1, 1) self.stackedWidget = QStackedWidget(self.groupBox) self.stackedWidget.setObjectName(u"stackedWidget") self.page = QWidget() self.page.setObjectName(u"page") self.gridLayout_2 = QGridLayout(self.page) self.gridLayout_2.setObjectName(u"gridLayout_2") self.label = QLabel(self.page) self.label.setObjectName(u"label") self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_2.addItem(self.verticalSpacer_2, 2, 2, 1, 1) self.label_4 = QLabel(self.page) self.label_4.setObjectName(u"label_4") self.gridLayout_2.addWidget(self.label_4, 1, 0, 1, 1) self.folder_url = KUrlRequester(self.page) self.folder_url.setObjectName(u"folder_url") self.gridLayout_2.addWidget(self.folder_url, 0, 1, 1, 2) self.image_type = KComboBox(self.page) self.image_type.setObjectName(u"image_type") self.gridLayout_2.addWidget(self.image_type, 1, 1, 1, 2) self.stackedWidget.addWidget(self.page) self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.gridLayout_3 = QGridLayout(self.page_2) self.gridLayout_3.setObjectName(u"gridLayout_3") self.label_5 = QLabel(self.page_2) self.label_5.setObjectName(u"label_5") self.gridLayout_3.addWidget(self.label_5, 0, 0, 1, 1) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_3.addItem(self.verticalSpacer, 1, 2, 1, 1) self.pattern_url = KUrlRequester(self.page_2) self.pattern_url.setObjectName(u"pattern_url") self.gridLayout_3.addWidget(self.pattern_url, 0, 1, 1, 2) self.stackedWidget.addWidget(self.page_2) self.gridLayout.addWidget(self.stackedWidget, 1, 0, 1, 2) self.gridLayout_4.addWidget(self.groupBox, 1, 0, 1, 4) self.buttonBox = QDialogButtonBox(SlideshowClip_UI) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout_4.addWidget(self.buttonBox, 14, 2, 1, 2) self.slide_loop = QCheckBox(SlideshowClip_UI) self.slide_loop.setObjectName(u"slide_loop") self.gridLayout_4.addWidget(self.slide_loop, 3, 0, 1, 1) self.clip_name = QLineEdit(SlideshowClip_UI) self.clip_name.setObjectName(u"clip_name") self.gridLayout_4.addWidget(self.clip_name, 0, 1, 1, 3) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.show_thumbs = QCheckBox(SlideshowClip_UI) self.show_thumbs.setObjectName(u"show_thumbs") self.horizontalLayout_3.addWidget(self.show_thumbs) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_3.addItem(self.horizontalSpacer) self.label_info = QLabel(SlideshowClip_UI) self.label_info.setObjectName(u"label_info") self.horizontalLayout_3.addWidget(self.label_info) self.gridLayout_4.addLayout(self.horizontalLayout_3, 13, 0, 1, 4) self.clip_duration_format = KComboBox(SlideshowClip_UI) self.clip_duration_format.setObjectName(u"clip_duration_format") self.gridLayout_4.addWidget(self.clip_duration_format, 2, 3, 1, 1) self.label_6 = QLabel(SlideshowClip_UI) self.label_6.setObjectName(u"label_6") self.gridLayout_4.addWidget(self.label_6, 10, 0, 1, 1) self.low_pass = QCheckBox(SlideshowClip_UI) self.low_pass.setObjectName(u"low_pass") self.low_pass.setEnabled(False) self.gridLayout_4.addWidget(self.low_pass, 11, 0, 1, 4) self.retranslateUi(SlideshowClip_UI) self.buttonBox.accepted.connect(SlideshowClip_UI.accept) self.buttonBox.rejected.connect(SlideshowClip_UI.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(SlideshowClip_UI)
def __init__(self): QMainWindow.__init__(self) # Variaveis self.separador = ";" # Separador padrao de colunas em um arquivo txt ou csv self.selected = np.array([1, 24, 48, 96]).astype('timedelta64[h]') # selecionados ao iniciar o programa, modificavel. self.fileformat = '' # Reservado para o formato do arquivo a ser aberto. Pode ser .xlsx ou .odf. ou .csv e assim vai. # facilita o acesso a variavel. self.timedeltastr = ("1 Hora","2 Horas", "3 Horas", "4 Horas","12 Horas", "24 Horas", "48 Horas", "72 horas", "96 horas", "30 Dias") self.timedeltas = np.array([1, 2, 3, 4, 12, 24, 48, 72, 96, 24*30]).astype('timedelta64[h]') self.linktimedelta = dict([(self.timedeltas[x], self.timedeltastr[x]) for x in range(len(self.timedeltastr))]) self.datastring = ["DD/MM/AAAA",'AAAA/MM/DD', "AAAA-MM-DD", "DD-MM-AAAA"] self.dataformat = ["%d/%m/%Y", "%Y/%m/%d", "%Y-%m-%d", "%d-%m-%Y"] self.linkdata = dict([(self.datastring[x], self.dataformat[x]) for x in range(len(self.dataformat))]) self.timestring = ["hh:mm", "hh:mm:ss", "hh:mm:ss.ms"] self.timeformat = ["%H:%M", "%H:%M:%S", "%H:%M:%S.%f"] self.linktime = dict([(self.timestring[x], self.timeformat[x]) for x in range(len(self.timeformat))]) #Janela Principal widget = QWidget() self.setCentralWidget(widget) # Inicializa os Widgets self.folder = QLineEdit("Salvar Como...") self.path = QLineEdit("Abrir arquivo...") # buttonOpen = QPushButton('Abrir') buttonSave = QPushButton("Destino") Processar = QPushButton('Executar') Ajuda = QPushButton('Informações') # groupBox2 = QGroupBox("Delimitador") self.delimitador1 = QRadioButton("Ponto-Vírgula") self.delimitador2 = QRadioButton("Vírgula") self.delimitador3 = QRadioButton("Ponto") self.delimitador4 = QRadioButton("Tabulação") # checkGroup = QGroupBox("Mais opções") text3 = QPushButton("Configurações") text2 = QLabel("Formato da Data") text1 = QLabel("Formato da Hora") self.FormatoTime = QComboBox() self.FormatoTime.addItems(self.timestring) self.FormatoData = QComboBox() self.FormatoData.addItems(self.datastring) # text = QLabel("Por favor, selecione na tabela abaixo as colunas a utilizar:") self.ignore = QRadioButton("Possui Cabeçalho") # True se estiver selecionado, False caso nao # self.Tabela = QTableWidget(15,15) self.startTable() # Layouts MainLayout = QVBoxLayout() Gridlayout = QGridLayout() Gridlayout.addWidget(self.path, 0, 0) Gridlayout.addWidget(self.folder, 1, 0) Gridlayout.addWidget(buttonOpen, 0, 1) Gridlayout.addWidget(buttonSave, 1, 1) Gridlayout.addWidget(Processar, 0, 3) Gridlayout.addWidget(Ajuda, 1, 3) Gridlayout.setColumnStretch(0, 2) Gridlayout.setColumnStretch(3, 1) Gridlayout.setColumnMinimumWidth(2, 20) SecondLayout = QHBoxLayout() SecondLayout.addWidget(groupBox2) SecondLayout.addSpacing(40) SecondLayout.addWidget(checkGroup) # SepLayout = QVBoxLayout() SepLayout.addWidget(self.delimitador1) SepLayout.addWidget(self.delimitador2) SepLayout.addWidget(self.delimitador3) SepLayout.addWidget(self.delimitador4) # OptionsLayout = QVBoxLayout() OptionsLayout.addWidget(text3) OptionsLayout.addWidget(text2) OptionsLayout.addWidget(self.FormatoData) OptionsLayout.addWidget(text1) OptionsLayout.addWidget(self.FormatoTime) ThirdLayout = QVBoxLayout() ThirdLayout.addWidget(self.ignore) ThirdLayout.addWidget(text) MainLayout.addLayout(Gridlayout) MainLayout.addLayout(SecondLayout) MainLayout.addLayout(ThirdLayout) MainLayout.addWidget(self.Tabela) # Coloca o Layout principal na Janela widget.setLayout(MainLayout) # Comandos dos Widgets e edicoes. groupBox2.setLayout(SepLayout) self.delimitador1.setChecked(True) self.folder.setReadOnly(True) self.path.setReadOnly(True) checkGroup.setLayout(OptionsLayout) buttonOpen.clicked.connect(self.searchFile) buttonSave.clicked.connect(self.getNewFile) self.delimitador1.clicked.connect(self.updateDelimiter) self.delimitador2.clicked.connect(self.updateDelimiter) self.delimitador3.clicked.connect(self.updateDelimiter) self.delimitador4.clicked.connect(self.updateDelimiter) Ajuda.clicked.connect(self.help) Processar.clicked.connect(self.taskStart) text3.clicked.connect(self.openSubWindow) # Propriedades da janela principal height = 480 width = 640 myappid = 'GePlu.release1_0.0' # arbitrary string ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid) self.setWindowIcon(QIcon(r'images\icon6.ico')) self.setFixedSize(width, height) self.setWindowTitle("GePlu")
def setupUi(self, Img): if not Img.objectName(): Img.setObjectName(u"Img") Img.resize(620, 559) self.gridLayout = QGridLayout(Img) self.gridLayout.setObjectName(u"gridLayout") self.graphicsView = QGraphicsView(Img) self.graphicsView.setObjectName(u"graphicsView") self.gridLayout.addWidget(self.graphicsView, 0, 0, 1, 1) self.verticalLayout = QVBoxLayout() self.verticalLayout.setObjectName(u"verticalLayout") self.line_3 = QFrame(Img) self.line_3.setObjectName(u"line_3") self.line_3.setFrameShape(QFrame.VLine) self.line_3.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line_3) self.verticalLayout_2 = QVBoxLayout() self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.line_5 = QFrame(Img) self.line_5.setObjectName(u"line_5") self.line_5.setFrameShape(QFrame.VLine) self.line_5.setFrameShadow(QFrame.Sunken) self.verticalLayout_2.addWidget(self.line_5) self.checkBox = QCheckBox(Img) self.checkBox.setObjectName(u"checkBox") self.checkBox.setMaximumSize(QSize(100, 16777215)) self.checkBox.setChecked(True) self.verticalLayout_2.addWidget(self.checkBox) self.ttaModel = QCheckBox(Img) self.ttaModel.setObjectName(u"ttaModel") self.ttaModel.setMaximumSize(QSize(70, 16777215)) self.verticalLayout_2.addWidget(self.ttaModel) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.scaleRadio = QRadioButton(Img) self.buttonGroup_2 = QButtonGroup(Img) self.buttonGroup_2.setObjectName(u"buttonGroup_2") self.buttonGroup_2.addButton(self.scaleRadio) self.scaleRadio.setObjectName(u"scaleRadio") self.scaleRadio.setMaximumSize(QSize(80, 16777215)) self.scaleRadio.setChecked(True) self.horizontalLayout_3.addWidget(self.scaleRadio) self.scaleEdit = QLineEdit(Img) self.scaleEdit.setObjectName(u"scaleEdit") self.scaleEdit.setMaximumSize(QSize(160, 16777215)) self.scaleEdit.setAlignment(Qt.AlignCenter) self.horizontalLayout_3.addWidget(self.scaleEdit) self.verticalLayout_2.addLayout(self.horizontalLayout_3) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.heighRadio = QRadioButton(Img) self.buttonGroup_2.addButton(self.heighRadio) self.heighRadio.setObjectName(u"heighRadio") self.heighRadio.setMaximumSize(QSize(80, 16777215)) self.horizontalLayout_4.addWidget(self.heighRadio) self.widthEdit = QLineEdit(Img) self.widthEdit.setObjectName(u"widthEdit") self.widthEdit.setEnabled(False) self.widthEdit.setMaximumSize(QSize(60, 16777215)) self.widthEdit.setAlignment(Qt.AlignCenter) self.horizontalLayout_4.addWidget(self.widthEdit) self.label_2 = QLabel(Img) self.label_2.setObjectName(u"label_2") self.label_2.setMaximumSize(QSize(20, 16777215)) self.horizontalLayout_4.addWidget(self.label_2) self.heighEdit = QLineEdit(Img) self.heighEdit.setObjectName(u"heighEdit") self.heighEdit.setEnabled(False) self.heighEdit.setMaximumSize(QSize(60, 16777215)) self.heighEdit.setAlignment(Qt.AlignCenter) self.horizontalLayout_4.addWidget(self.heighEdit) self.verticalLayout_2.addLayout(self.horizontalLayout_4) self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.label_4 = QLabel(Img) self.label_4.setObjectName(u"label_4") self.label_4.setMaximumSize(QSize(60, 16777215)) self.horizontalLayout_5.addWidget(self.label_4) self.noiseCombox = QComboBox(Img) self.noiseCombox.addItem("") self.noiseCombox.addItem("") self.noiseCombox.addItem("") self.noiseCombox.addItem("") self.noiseCombox.addItem("") self.noiseCombox.setObjectName(u"noiseCombox") self.noiseCombox.setMaximumSize(QSize(160, 16777215)) self.horizontalLayout_5.addWidget(self.noiseCombox) self.verticalLayout_2.addLayout(self.horizontalLayout_5) self.horizontalLayout_6 = QHBoxLayout() self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") self.label_5 = QLabel(Img) self.label_5.setObjectName(u"label_5") self.label_5.setMaximumSize(QSize(60, 16777215)) self.horizontalLayout_6.addWidget(self.label_5) self.comboBox = QComboBox(Img) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.comboBox.setMaximumSize(QSize(160, 16777215)) self.horizontalLayout_6.addWidget(self.comboBox) self.verticalLayout_2.addLayout(self.horizontalLayout_6) self.horizontalLayout_7 = QHBoxLayout() self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") self.changeJpg = QPushButton(Img) self.changeJpg.setObjectName(u"changeJpg") self.changeJpg.setMaximumSize(QSize(100, 16777215)) self.horizontalLayout_7.addWidget(self.changeJpg) self.changePng = QPushButton(Img) self.changePng.setObjectName(u"changePng") self.changePng.setMaximumSize(QSize(100, 16777215)) self.horizontalLayout_7.addWidget(self.changePng) self.changeLabel = QLabel(Img) self.changeLabel.setObjectName(u"changeLabel") self.changeLabel.setMaximumSize(QSize(100, 16777215)) self.changeLabel.setAlignment(Qt.AlignCenter) self.horizontalLayout_7.addWidget(self.changeLabel) self.verticalLayout_2.addLayout(self.horizontalLayout_7) self.horizontalLayout_11 = QHBoxLayout() self.horizontalLayout_11.setObjectName(u"horizontalLayout_11") self.verticalLayout_2.addLayout(self.horizontalLayout_11) self.verticalLayout.addLayout(self.verticalLayout_2) self.line = QFrame(Img) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.VLine) self.line.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line) self.line_4 = QFrame(Img) self.line_4.setObjectName(u"line_4") self.line_4.setFrameShape(QFrame.HLine) self.line_4.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line_4) self.verticalLayout_3 = QVBoxLayout() self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.horizontalLayout_8 = QHBoxLayout() self.horizontalLayout_8.setObjectName(u"horizontalLayout_8") self.label_8 = QLabel(Img) self.label_8.setObjectName(u"label_8") self.label_8.setMaximumSize(QSize(60, 16777215)) self.horizontalLayout_8.addWidget(self.label_8) self.resolutionLabel = QLabel(Img) self.resolutionLabel.setObjectName(u"resolutionLabel") self.resolutionLabel.setMaximumSize(QSize(160, 16777215)) self.horizontalLayout_8.addWidget(self.resolutionLabel) self.verticalLayout_3.addLayout(self.horizontalLayout_8) self.horizontalLayout_9 = QHBoxLayout() self.horizontalLayout_9.setObjectName(u"horizontalLayout_9") self.label_10 = QLabel(Img) self.label_10.setObjectName(u"label_10") self.label_10.setMaximumSize(QSize(60, 16777215)) self.horizontalLayout_9.addWidget(self.label_10) self.sizeLabel = QLabel(Img) self.sizeLabel.setObjectName(u"sizeLabel") self.sizeLabel.setMaximumSize(QSize(160, 16777215)) self.horizontalLayout_9.addWidget(self.sizeLabel) self.verticalLayout_3.addLayout(self.horizontalLayout_9) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.label = QLabel(Img) self.label.setObjectName(u"label") self.label.setMaximumSize(QSize(60, 16777215)) self.horizontalLayout.addWidget(self.label) self.gpuName = QLabel(Img) self.gpuName.setObjectName(u"gpuName") self.gpuName.setMaximumSize(QSize(160, 16777215)) self.horizontalLayout.addWidget(self.gpuName) self.verticalLayout_3.addLayout(self.horizontalLayout) self.horizontalLayout_10 = QHBoxLayout() self.horizontalLayout_10.setObjectName(u"horizontalLayout_10") self.label_6 = QLabel(Img) self.label_6.setObjectName(u"label_6") self.label_6.setMaximumSize(QSize(60, 16777215)) self.horizontalLayout_10.addWidget(self.label_6) self.tickLabel = QLabel(Img) self.tickLabel.setObjectName(u"tickLabel") self.tickLabel.setMaximumSize(QSize(160, 16777215)) self.horizontalLayout_10.addWidget(self.tickLabel) self.verticalLayout_3.addLayout(self.horizontalLayout_10) self.oepnButton = QPushButton(Img) self.oepnButton.setObjectName(u"oepnButton") self.oepnButton.setMaximumSize(QSize(100, 16777215)) self.verticalLayout_3.addWidget(self.oepnButton) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.verticalLayout_3.addLayout(self.horizontalLayout_2) self.pushButton_3 = QPushButton(Img) self.pushButton_3.setObjectName(u"pushButton_3") self.pushButton_3.setMaximumSize(QSize(100, 16777215)) self.verticalLayout_3.addWidget(self.pushButton_3) self.pushButton = QPushButton(Img) self.pushButton.setObjectName(u"pushButton") self.pushButton.setMaximumSize(QSize(100, 16777215)) self.verticalLayout_3.addWidget(self.pushButton) self.saveButton = QPushButton(Img) self.saveButton.setObjectName(u"saveButton") self.saveButton.setMaximumSize(QSize(100, 16777215)) self.verticalLayout_3.addWidget(self.saveButton) self.verticalLayout.addLayout(self.verticalLayout_3) self.line_6 = QFrame(Img) self.line_6.setObjectName(u"line_6") self.line_6.setFrameShape(QFrame.HLine) self.line_6.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line_6) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.verticalLayout.addItem(self.verticalSpacer) self.line_2 = QFrame(Img) self.line_2.setObjectName(u"line_2") self.line_2.setFrameShape(QFrame.VLine) self.line_2.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line_2) self.gridLayout.addLayout(self.verticalLayout, 0, 1, 1, 1) self.retranslateUi(Img) self.checkBox.clicked.connect(Img.SwithPicture) self.saveButton.clicked.connect(Img.SavePicture) self.heighEdit.textChanged.connect(Img.CheckScaleRadio) self.pushButton_3.clicked.connect(Img.ReduceScalePic) self.heighRadio.clicked.connect(Img.CheckScaleRadio) self.ttaModel.clicked.connect(Img.CheckScaleRadio) self.oepnButton.clicked.connect(Img.OpenPicture) self.widthEdit.textChanged.connect(Img.CheckScaleRadio) self.pushButton.clicked.connect(Img.AddScalePic) self.scaleEdit.textChanged.connect(Img.CheckScaleRadio) self.scaleRadio.clicked.connect(Img.CheckScaleRadio) self.comboBox.currentIndexChanged.connect(Img.ChangeModel) self.changeJpg.clicked.connect(Img.StartWaifu2x) self.noiseCombox.currentIndexChanged.connect(Img.CheckScaleRadio) self.changePng.clicked.connect(Img.StartWaifu2xPng) self.changeJpg.clicked.connect(Img.StartWaifu2xJPG) QMetaObject.connectSlotsByName(Img)
def __init__(self, stages: list[Stage], *args, **kwargs): QMainWindow.__init__(self, *args, **kwargs) if not self.objectName(): self.setObjectName("MainWindow") self.resize(800, 600) size_policy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) size_policy.setHorizontalStretch(0) size_policy.setVerticalStretch(0) size_policy.setHeightForWidth(self.sizePolicy().hasHeightForWidth()) self.setSizePolicy(size_policy) self.setWindowTitle("Interfan") self.central_widget = QWidget(self) self.central_widget.setObjectName("central_widget") self.main_horizontal_layout = QHBoxLayout(self.central_widget) self.main_horizontal_layout.setObjectName("main_horizontal_layout") self.left_grid_layout = QGridLayout() self.left_grid_layout.setObjectName("left_grid_layout") self.slice_slider = QSlider(self.central_widget) self.slice_slider.setObjectName("slice_slider") self.slice_slider.setEnabled(False) self.slice_slider.setOrientation(Qt.Horizontal) self.left_grid_layout.addWidget(self.slice_slider, 1, 0, 1, 1) self.slice_label = QLabel(self.central_widget) self.slice_label.setObjectName("slice_label") self.slice_label.setGeometry(QRect(0, 10, 58, 18)) self.slice_label.setText("0") self.left_grid_layout.addWidget(self.slice_label, 1, 1, 1, 1) self.main_image_scene = QGraphicsScene() self.main_image_view = QGraphicsView(self.main_image_scene) self.main_image_view.setObjectName("main_image_view") self.left_grid_layout.addWidget(self.main_image_view, 0, 0, 1, 1) self.slice_image_scene = QGraphicsScene() self.slice_image_view = QGraphicsView(self.slice_image_scene) self.slice_image_view.setObjectName("slice_image_view") self.left_grid_layout.addWidget(self.slice_image_view, 0, 1, 1, 1) self.left_grid_layout.setRowStretch(0, 12) self.left_grid_layout.setRowStretch(1, 1) self.left_grid_layout.setColumnStretch(0, 6) self.left_grid_layout.setColumnStretch(1, 1) self.main_horizontal_layout.addLayout(self.left_grid_layout) self.right_vertical_layout = QVBoxLayout() self.right_vertical_layout.setObjectName("right_vertical_layout") self.settings_widget = SettingWidget(self.central_widget) self.right_vertical_layout.addWidget(self.settings_widget.group_box) self.proceed_button = QPushButton(self.central_widget) self.proceed_button.setObjectName("proceed_button") self.proceed_button.setText("Выполнить") self.proceed_button.setEnabled(False) self.right_vertical_layout.addWidget(self.proceed_button) self.right_down_layout = QHBoxLayout() self.right_down_layout.setObjectName("right_down_layout") self.stages_layout = QVBoxLayout() self.stages_layout.setObjectName("stages_layout") self.stages_label = QLabel(self.central_widget) self.stages_label.setObjectName("stages_label") self.stages_label.setText("Этапы") self.stages_layout.addWidget(self.stages_label, 1) self.stages_radio_buttons = [] for s in stages: rb = QRadioButton(self.central_widget) rb.setObjectName("stages_radio_button") rb.setEnabled(False) rb.setText(s.name) self.stages_layout.addWidget(rb, 1) self.stages_radio_buttons.append(rb) self.stages_radio_buttons[0].setEnabled(True) self.stages_radio_buttons[0].setChecked(True) self.set_stage(stages[0]) self.right_down_layout.addLayout(self.stages_layout) self.history_layout = QVBoxLayout() self.history_layout.setObjectName("history_layout") self.history_header_layout = QHBoxLayout() self.history_header_layout.setObjectName("history_header_layout") self.history_label = QLabel(self.central_widget) self.history_label.setObjectName("history_label") self.history_label.setText("История операций") self.history_header_layout.addWidget(self.history_label) self.history_minus_button = QToolButton(self.central_widget) self.history_minus_button.setObjectName("history_minus_button") self.history_minus_button.setEnabled(False) self.history_minus_button.setText("-") self.history_header_layout.addWidget(self.history_minus_button) self.history_header_layout.setStretch(0, 8) self.history_header_layout.setStretch(1, 1) self.history_layout.addLayout(self.history_header_layout) self.history_list_view = QListView(self.central_widget) self.history_list_view.setObjectName("history_list_view") self.history_layout.addWidget(self.history_list_view) self.history_script_button = QPushButton(self.central_widget) self.history_script_button.setObjectName("history_script_button") self.history_script_button.setText("Просмотреть как скрипт") self.history_layout.addWidget(self.history_script_button) self.right_down_layout.addLayout(self.history_layout) self.right_down_layout.setStretch(0, 1) self.right_down_layout.setStretch(1, 1) self.right_vertical_layout.addLayout(self.right_down_layout) self.right_vertical_layout.setStretch(0, 1) self.right_vertical_layout.setStretch(1, 0) self.right_vertical_layout.setStretch(2, 1) self.main_horizontal_layout.addLayout(self.right_vertical_layout) self.main_horizontal_layout.setStretch(0, 1) self.main_horizontal_layout.setStretch(1, 1) self.setCentralWidget(self.central_widget) self.menu_bar = QMenuBar(self) self.menu_bar.setObjectName("menu_bar") self.menu_bar.setGeometry(QRect(0, 0, 800, 30)) self.menu = QMenu(self.menu_bar) self.menu.setObjectName("men") self.menu.setTitle("Меню") self.setMenuBar(self.menu_bar) self.open_file = QAction(self) self.open_file.setObjectName("open_file") self.open_file.setText("Открыть файл") self.menu.addAction(self.open_file) self.status_bar = QStatusBar(self) self.status_bar.setObjectName("status_bar") self.setStatusBar(self.status_bar) self.menu_bar.addAction(self.menu.menuAction()) QMetaObject.connectSlotsByName(self)
def setupUi(self, CalcyOption): if not CalcyOption.objectName(): CalcyOption.setObjectName(u"CalcyOption") CalcyOption.resize(516, 262) self.horizontalLayout_2 = QHBoxLayout(CalcyOption) self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.tabWidget = QTabWidget(CalcyOption) self.tabWidget.setObjectName(u"tabWidget") font = QFont() font.setFamilies([u"Verdana"]) font.setPointSize(10) self.tabWidget.setFont(font) self.tabOutput = QWidget() self.tabOutput.setObjectName(u"tabOutput") self.formLayout = QFormLayout(self.tabOutput) self.formLayout.setObjectName(u"formLayout") self.verticalLayout_5 = QVBoxLayout() self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.groupBox_2 = QGroupBox(self.tabOutput) self.groupBox_2.setObjectName(u"groupBox_2") self.verticalLayout_6 = QVBoxLayout(self.groupBox_2) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.radioButtonDecSepSystem = QRadioButton(self.groupBox_2) self.radioButtonDecSepSystem.setObjectName(u"radioButtonDecSepSystem") self.radioButtonDecSepSystem.setChecked(True) self.verticalLayout_6.addWidget(self.radioButtonDecSepSystem) self.radioButtonDecSepComa = QRadioButton(self.groupBox_2) self.radioButtonDecSepComa.setObjectName(u"radioButtonDecSepComa") self.verticalLayout_6.addWidget(self.radioButtonDecSepComa) self.radioButtonDecSepDot = QRadioButton(self.groupBox_2) self.radioButtonDecSepDot.setObjectName(u"radioButtonDecSepDot") self.verticalLayout_6.addWidget(self.radioButtonDecSepDot) self.verticalLayout_5.addWidget(self.groupBox_2) self.verticalLayout_4 = QVBoxLayout() self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.label = QLabel(self.tabOutput) self.label.setObjectName(u"label") self.horizontalLayout_3.addWidget(self.label) self.spinBoxOutputPrecision = QSpinBox(self.tabOutput) self.spinBoxOutputPrecision.setObjectName(u"spinBoxOutputPrecision") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.spinBoxOutputPrecision.sizePolicy().hasHeightForWidth()) self.spinBoxOutputPrecision.setSizePolicy(sizePolicy) self.spinBoxOutputPrecision.setMinimumSize(QSize(55, 0)) self.spinBoxOutputPrecision.setMaximumSize(QSize(60, 30)) self.spinBoxOutputPrecision.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.spinBoxOutputPrecision.setMinimum(1) self.spinBoxOutputPrecision.setMaximum(10) self.spinBoxOutputPrecision.setValue(3) self.horizontalLayout_3.addWidget(self.spinBoxOutputPrecision) self.verticalLayout_4.addLayout(self.horizontalLayout_3) self.checkBoxShowGrpSep = QCheckBox(self.tabOutput) self.checkBoxShowGrpSep.setObjectName(u"checkBoxShowGrpSep") self.checkBoxShowGrpSep.setChecked(False) self.verticalLayout_4.addWidget(self.checkBoxShowGrpSep) self.checkBoxCopyToClipboard = QCheckBox(self.tabOutput) self.checkBoxCopyToClipboard.setObjectName(u"checkBoxCopyToClipboard") self.checkBoxCopyToClipboard.setChecked(True) self.verticalLayout_4.addWidget(self.checkBoxCopyToClipboard) self.verticalLayout_5.addLayout(self.verticalLayout_4) self.formLayout.setLayout(0, QFormLayout.LabelRole, self.verticalLayout_5) self.tabWidget.addTab(self.tabOutput, "") self.tabRadix = QWidget() self.tabRadix.setObjectName(u"tabRadix") self.horizontalLayout_6 = QHBoxLayout(self.tabRadix) self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") self.verticalLayout_3 = QVBoxLayout() self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.groupBox_3 = QGroupBox(self.tabRadix) self.groupBox_3.setObjectName(u"groupBox_3") self.horizontalLayout = QHBoxLayout(self.groupBox_3) self.horizontalLayout.setObjectName(u"horizontalLayout") self.checkBoxBinOut = QCheckBox(self.groupBox_3) self.checkBoxBinOut.setObjectName(u"checkBoxBinOut") self.checkBoxBinOut.setChecked(True) self.horizontalLayout.addWidget(self.checkBoxBinOut) self.checkBoxOctOut = QCheckBox(self.groupBox_3) self.checkBoxOctOut.setObjectName(u"checkBoxOctOut") self.checkBoxOctOut.setChecked(True) self.horizontalLayout.addWidget(self.checkBoxOctOut) self.checkBoxHexOut = QCheckBox(self.groupBox_3) self.checkBoxHexOut.setObjectName(u"checkBoxHexOut") self.checkBoxHexOut.setChecked(True) self.horizontalLayout.addWidget(self.checkBoxHexOut) self.checkBoxSizeOut = QCheckBox(self.groupBox_3) self.checkBoxSizeOut.setObjectName(u"checkBoxSizeOut") self.checkBoxSizeOut.setChecked(True) self.horizontalLayout.addWidget(self.checkBoxSizeOut) self.verticalLayout_3.addWidget(self.groupBox_3) self.verticalLayout = QVBoxLayout() self.verticalLayout.setObjectName(u"verticalLayout") self.checkBoxShowBasePrefix = QCheckBox(self.tabRadix) self.checkBoxShowBasePrefix.setObjectName(u"checkBoxShowBasePrefix") self.checkBoxShowBasePrefix.setChecked(True) self.verticalLayout.addWidget(self.checkBoxShowBasePrefix) self.checkBoxShowLeadingZerosBin = QCheckBox(self.tabRadix) self.checkBoxShowLeadingZerosBin.setObjectName(u"checkBoxShowLeadingZerosBin") self.checkBoxShowLeadingZerosBin.setChecked(True) self.verticalLayout.addWidget(self.checkBoxShowLeadingZerosBin) self.checkBoxShowLeadingZerosOct = QCheckBox(self.tabRadix) self.checkBoxShowLeadingZerosOct.setObjectName(u"checkBoxShowLeadingZerosOct") self.checkBoxShowLeadingZerosOct.setChecked(True) self.verticalLayout.addWidget(self.checkBoxShowLeadingZerosOct) self.checkBoxShowLeadingZerosHex = QCheckBox(self.tabRadix) self.checkBoxShowLeadingZerosHex.setObjectName(u"checkBoxShowLeadingZerosHex") self.checkBoxShowLeadingZerosHex.setChecked(True) self.verticalLayout.addWidget(self.checkBoxShowLeadingZerosHex) self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.verticalLayout.addItem(self.verticalSpacer_2) self.verticalLayout_3.addLayout(self.verticalLayout) self.horizontalLayout_6.addLayout(self.verticalLayout_3) self.verticalLayout_2 = QVBoxLayout() self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.groupBoxBW = QGroupBox(self.tabRadix) self.groupBoxBW.setObjectName(u"groupBoxBW") self.horizontalLayout_5 = QHBoxLayout(self.groupBoxBW) self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.radioButtonBW64 = QRadioButton(self.groupBoxBW) self.radioButtonBW64.setObjectName(u"radioButtonBW64") self.horizontalLayout_5.addWidget(self.radioButtonBW64) self.radioButtonBW32 = QRadioButton(self.groupBoxBW) self.radioButtonBW32.setObjectName(u"radioButtonBW32") self.horizontalLayout_5.addWidget(self.radioButtonBW32) self.radioButtonBW16 = QRadioButton(self.groupBoxBW) self.radioButtonBW16.setObjectName(u"radioButtonBW16") self.radioButtonBW16.setChecked(True) self.horizontalLayout_5.addWidget(self.radioButtonBW16) self.radioButtonBW8 = QRadioButton(self.groupBoxBW) self.radioButtonBW8.setObjectName(u"radioButtonBW8") self.horizontalLayout_5.addWidget(self.radioButtonBW8) self.verticalLayout_2.addWidget(self.groupBoxBW) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.verticalLayout_2.addItem(self.verticalSpacer) self.horizontalLayout_6.addLayout(self.verticalLayout_2) self.tabWidget.addTab(self.tabRadix, "") self.horizontalLayout_2.addWidget(self.tabWidget) self.retranslateUi(CalcyOption) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(CalcyOption)
def __init__(self, ruler, parent=None): QWidget.__init__(self, parent) # units (cm/px/inch) unitsGroup = QButtonGroup(self) pixels = QRadioButton('Pixels') pixels.unit = 'px' centimeters = QRadioButton('Centimeters') centimeters.unit = 'cm' inches = QRadioButton('Inches') inches.unit = 'inch' selectedUnit = ruler.data.get('units') if selectedUnit == 'cm': centimeters.setChecked(True) elif selectedUnit == 'inch': inches.setChecked(True) else: pixels.setChecked(True) unitsGroup.addButton(pixels) unitsGroup.addButton(centimeters) unitsGroup.addButton(inches) def changeUnits(radioButton): nonlocal selectedUnit newUnit = radioButton.unit if newUnit != selectedUnit: ruler.data.update('units', newUnit) selectedUnit = newUnit ruler.update() unitsGroup.buttonClicked.connect(changeUnits) # orientation (horizontal/vertical) horizontalOrientation = ruler.data.get('horizontal_orientation') orientationGroup = QButtonGroup(self) self.horizontal_string = 'Horizontal' self.vertical_string = 'Vertical' horizontal = QRadioButton(self.horizontal_string) vertical = QRadioButton(self.vertical_string) if horizontalOrientation: horizontal.setChecked(True) self.selected_orientation = self.horizontal_string else: vertical.setChecked(True) self.selected_orientation = self.vertical_string def changeOrientation(radioButton): text = radioButton.text() if self.selected_orientation != text: self.selected_orientation = text ruler.rotate() orientationGroup.addButton(horizontal) orientationGroup.addButton(vertical) orientationGroup.buttonClicked.connect(changeOrientation) # length settings (always above + division lines + current length) alwaysAbove = QCheckBox('Always Above', self) alwaysAbove.setChecked(ruler.data.get('always_above')) def alwaysAboveSetting(): if alwaysAbove.isChecked(): ruler.data.update('always_above', True) ruler.setWindowFlags(ruler.windowFlags() | Qt.WindowStaysOnTopHint) else: ruler.data.update('always_above', False) ruler.setWindowFlags(ruler.windowFlags() & ~Qt.WindowStaysOnTopHint) ruler.show() alwaysAbove.clicked.connect(alwaysAboveSetting) divisionLines = QCheckBox('1/2 1/4 3/4 divisions', self) divisionLines.setChecked(ruler.data.get('division_lines')) def divisionLinesSetting(): ruler.data.update('division_lines', divisionLines.isChecked()) ruler.update() divisionLines.clicked.connect(divisionLinesSetting) currentLength = QLabel('0px') currentLength.setAlignment(Qt.AlignCenter) # setup the layout layout = QGridLayout() layout.setSpacing(10) # set the same width/height for all the columns/rows columnWidth = 120 rowHeight = 25 layout.setRowMinimumHeight(0, rowHeight) layout.setRowMinimumHeight(1, rowHeight) layout.setRowMinimumHeight(2, rowHeight) layout.setColumnMinimumWidth(0, columnWidth) layout.setColumnMinimumWidth(1, columnWidth) layout.setColumnMinimumWidth(2, columnWidth) # first column layout.addWidget(pixels, 0, 0) layout.addWidget(centimeters, 1, 0) layout.addWidget(inches, 2, 0) # second column layout.addWidget(horizontal, 0, 1) layout.addWidget(vertical, 1, 1) # third column layout.addWidget(alwaysAbove, 0, 2) layout.addWidget(divisionLines, 1, 2) layout.addWidget(currentLength, 2, 2) layout.setSizeConstraint(QLayout.SetFixedSize) self.current_length = currentLength self.vertical = vertical self.horizontal = horizontal self.setLayout(layout)
def setupUi(self, ReBuildDialog): if not ReBuildDialog.objectName(): ReBuildDialog.setObjectName(u"ReBuildDialog") ReBuildDialog.setWindowModality(Qt.ApplicationModal) ReBuildDialog.resize(268, 150) sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( ReBuildDialog.sizePolicy().hasHeightForWidth()) ReBuildDialog.setSizePolicy(sizePolicy) font = QFont() font.setFamilies([u"DejaVu Sans"]) ReBuildDialog.setFont(font) self.verticalLayout = QVBoxLayout(ReBuildDialog) self.verticalLayout.setSpacing(2) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.TypeGroup = QGroupBox(ReBuildDialog) self.TypeGroup.setObjectName(u"TypeGroup") sizePolicy1 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.TypeGroup.sizePolicy().hasHeightForWidth()) self.TypeGroup.setSizePolicy(sizePolicy1) self.formLayout = QFormLayout(self.TypeGroup) self.formLayout.setObjectName(u"formLayout") self.formLayout.setSizeConstraint(QLayout.SetMinimumSize) self.formLayout.setFieldGrowthPolicy(QFormLayout.FieldsStayAtSizeHint) self.formLayout.setHorizontalSpacing(15) self.formLayout.setVerticalSpacing(0) self.formLayout.setContentsMargins(2, 0, 2, 0) self.AllRadioButton = QRadioButton(self.TypeGroup) self.AllRadioButton.setObjectName(u"AllRadioButton") self.formLayout.setWidget(0, QFormLayout.LabelRole, self.AllRadioButton) self.LastRadioButton = QRadioButton(self.TypeGroup) self.LastRadioButton.setObjectName(u"LastRadioButton") self.formLayout.setWidget(1, QFormLayout.LabelRole, self.LastRadioButton) self.FrontierDateLabel = QLabel(self.TypeGroup) self.FrontierDateLabel.setObjectName(u"FrontierDateLabel") self.formLayout.setWidget(1, QFormLayout.FieldRole, self.FrontierDateLabel) self.DateRadionButton = QRadioButton(self.TypeGroup) self.DateRadionButton.setObjectName(u"DateRadionButton") self.formLayout.setWidget(2, QFormLayout.LabelRole, self.DateRadionButton) self.CustomDateEdit = QDateEdit(self.TypeGroup) self.CustomDateEdit.setObjectName(u"CustomDateEdit") self.CustomDateEdit.setCalendarPopup(True) self.CustomDateEdit.setTimeSpec(Qt.UTC) self.formLayout.setWidget(2, QFormLayout.FieldRole, self.CustomDateEdit) self.verticalLayout.addWidget(self.TypeGroup) self.FastAndDirty = QCheckBox(ReBuildDialog) self.FastAndDirty.setObjectName(u"FastAndDirty") self.FastAndDirty.setChecked(True) self.verticalLayout.addWidget(self.FastAndDirty) self.DialogButtonBox = QDialogButtonBox(ReBuildDialog) self.DialogButtonBox.setObjectName(u"DialogButtonBox") sizePolicy1.setHeightForWidth( self.DialogButtonBox.sizePolicy().hasHeightForWidth()) self.DialogButtonBox.setSizePolicy(sizePolicy1) self.DialogButtonBox.setOrientation(Qt.Horizontal) self.DialogButtonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.DialogButtonBox) self.retranslateUi(ReBuildDialog) self.DialogButtonBox.accepted.connect(ReBuildDialog.accept) self.DialogButtonBox.rejected.connect(ReBuildDialog.reject) QMetaObject.connectSlotsByName(ReBuildDialog)
def setupUi(self, Config): if not Config.objectName(): Config.setObjectName(u"Config") Config.resize(600, 650) Config.setSizeGripEnabled(True) self.vboxLayout = QVBoxLayout(Config) self.vboxLayout.setSpacing(6) self.vboxLayout.setContentsMargins(11, 11, 11, 11) self.vboxLayout.setObjectName(u"vboxLayout") self.vboxLayout.setContentsMargins(8, 8, 8, 8) self.hboxLayout = QHBoxLayout() self.hboxLayout.setSpacing(6) self.hboxLayout.setObjectName(u"hboxLayout") self.hboxLayout.setContentsMargins(0, 0, 0, 0) self.ButtonGroup1 = QGroupBox(Config) self.ButtonGroup1.setObjectName(u"ButtonGroup1") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ButtonGroup1.sizePolicy().hasHeightForWidth()) self.ButtonGroup1.setSizePolicy(sizePolicy) self.vboxLayout1 = QVBoxLayout(self.ButtonGroup1) self.vboxLayout1.setSpacing(6) self.vboxLayout1.setContentsMargins(11, 11, 11, 11) self.vboxLayout1.setObjectName(u"vboxLayout1") self.vboxLayout1.setContentsMargins(11, 11, 11, 11) self.size_176_220 = QRadioButton(self.ButtonGroup1) self.size_176_220.setObjectName(u"size_176_220") self.vboxLayout1.addWidget(self.size_176_220) self.size_240_320 = QRadioButton(self.ButtonGroup1) self.size_240_320.setObjectName(u"size_240_320") self.vboxLayout1.addWidget(self.size_240_320) self.size_320_240 = QRadioButton(self.ButtonGroup1) self.size_320_240.setObjectName(u"size_320_240") self.vboxLayout1.addWidget(self.size_320_240) self.size_640_480 = QRadioButton(self.ButtonGroup1) self.size_640_480.setObjectName(u"size_640_480") self.vboxLayout1.addWidget(self.size_640_480) self.size_800_600 = QRadioButton(self.ButtonGroup1) self.size_800_600.setObjectName(u"size_800_600") self.vboxLayout1.addWidget(self.size_800_600) self.size_1024_768 = QRadioButton(self.ButtonGroup1) self.size_1024_768.setObjectName(u"size_1024_768") self.vboxLayout1.addWidget(self.size_1024_768) self.hboxLayout1 = QHBoxLayout() self.hboxLayout1.setSpacing(6) self.hboxLayout1.setObjectName(u"hboxLayout1") self.hboxLayout1.setContentsMargins(0, 0, 0, 0) self.size_custom = QRadioButton(self.ButtonGroup1) self.size_custom.setObjectName(u"size_custom") sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.size_custom.sizePolicy().hasHeightForWidth()) self.size_custom.setSizePolicy(sizePolicy1) self.hboxLayout1.addWidget(self.size_custom) self.size_width = QSpinBox(self.ButtonGroup1) self.size_width.setObjectName(u"size_width") self.size_width.setMinimum(1) self.size_width.setMaximum(1280) self.size_width.setSingleStep(16) self.size_width.setValue(400) self.hboxLayout1.addWidget(self.size_width) self.size_height = QSpinBox(self.ButtonGroup1) self.size_height.setObjectName(u"size_height") self.size_height.setMinimum(1) self.size_height.setMaximum(1024) self.size_height.setSingleStep(16) self.size_height.setValue(300) self.hboxLayout1.addWidget(self.size_height) self.vboxLayout1.addLayout(self.hboxLayout1) self.hboxLayout.addWidget(self.ButtonGroup1) self.ButtonGroup2 = QGroupBox(Config) self.ButtonGroup2.setObjectName(u"ButtonGroup2") self.vboxLayout2 = QVBoxLayout(self.ButtonGroup2) self.vboxLayout2.setSpacing(6) self.vboxLayout2.setContentsMargins(11, 11, 11, 11) self.vboxLayout2.setObjectName(u"vboxLayout2") self.vboxLayout2.setContentsMargins(11, 11, 11, 11) self.depth_1 = QRadioButton(self.ButtonGroup2) self.depth_1.setObjectName(u"depth_1") self.vboxLayout2.addWidget(self.depth_1) self.depth_4gray = QRadioButton(self.ButtonGroup2) self.depth_4gray.setObjectName(u"depth_4gray") self.vboxLayout2.addWidget(self.depth_4gray) self.depth_8 = QRadioButton(self.ButtonGroup2) self.depth_8.setObjectName(u"depth_8") self.vboxLayout2.addWidget(self.depth_8) self.depth_12 = QRadioButton(self.ButtonGroup2) self.depth_12.setObjectName(u"depth_12") self.vboxLayout2.addWidget(self.depth_12) self.depth_15 = QRadioButton(self.ButtonGroup2) self.depth_15.setObjectName(u"depth_15") self.vboxLayout2.addWidget(self.depth_15) self.depth_16 = QRadioButton(self.ButtonGroup2) self.depth_16.setObjectName(u"depth_16") self.vboxLayout2.addWidget(self.depth_16) self.depth_18 = QRadioButton(self.ButtonGroup2) self.depth_18.setObjectName(u"depth_18") self.vboxLayout2.addWidget(self.depth_18) self.depth_24 = QRadioButton(self.ButtonGroup2) self.depth_24.setObjectName(u"depth_24") self.vboxLayout2.addWidget(self.depth_24) self.depth_32 = QRadioButton(self.ButtonGroup2) self.depth_32.setObjectName(u"depth_32") self.vboxLayout2.addWidget(self.depth_32) self.depth_32_argb = QRadioButton(self.ButtonGroup2) self.depth_32_argb.setObjectName(u"depth_32_argb") self.vboxLayout2.addWidget(self.depth_32_argb) self.hboxLayout.addWidget(self.ButtonGroup2) self.vboxLayout.addLayout(self.hboxLayout) self.hboxLayout2 = QHBoxLayout() self.hboxLayout2.setSpacing(6) self.hboxLayout2.setObjectName(u"hboxLayout2") self.hboxLayout2.setContentsMargins(0, 0, 0, 0) self.TextLabel1_3 = QLabel(Config) self.TextLabel1_3.setObjectName(u"TextLabel1_3") self.hboxLayout2.addWidget(self.TextLabel1_3) self.skin = QComboBox(Config) self.skin.addItem("") self.skin.setObjectName(u"skin") sizePolicy2 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.skin.sizePolicy().hasHeightForWidth()) self.skin.setSizePolicy(sizePolicy2) self.hboxLayout2.addWidget(self.skin) self.vboxLayout.addLayout(self.hboxLayout2) self.touchScreen = QCheckBox(Config) self.touchScreen.setObjectName(u"touchScreen") self.vboxLayout.addWidget(self.touchScreen) self.lcdScreen = QCheckBox(Config) self.lcdScreen.setObjectName(u"lcdScreen") self.vboxLayout.addWidget(self.lcdScreen) self.spacerItem = QSpacerItem(20, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) self.vboxLayout.addItem(self.spacerItem) self.TextLabel1 = QLabel(Config) self.TextLabel1.setObjectName(u"TextLabel1") sizePolicy.setHeightForWidth( self.TextLabel1.sizePolicy().hasHeightForWidth()) self.TextLabel1.setSizePolicy(sizePolicy) self.TextLabel1.setWordWrap(True) self.vboxLayout.addWidget(self.TextLabel1) self.GroupBox1 = QGroupBox(Config) self.GroupBox1.setObjectName(u"GroupBox1") self.gridLayout = QGridLayout(self.GroupBox1) self.gridLayout.setSpacing(6) self.gridLayout.setContentsMargins(11, 11, 11, 11) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setHorizontalSpacing(6) self.gridLayout.setVerticalSpacing(6) self.gridLayout.setContentsMargins(11, 11, 11, 11) self.TextLabel3 = QLabel(self.GroupBox1) self.TextLabel3.setObjectName(u"TextLabel3") self.gridLayout.addWidget(self.TextLabel3, 6, 0, 1, 1) self.bslider = QSlider(self.GroupBox1) self.bslider.setObjectName(u"bslider") palette = QPalette() brush = QBrush(QColor(128, 128, 128, 255)) brush.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.WindowText, brush) brush1 = QBrush(QColor(0, 0, 255, 255)) brush1.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Button, brush1) brush2 = QBrush(QColor(127, 127, 255, 255)) brush2.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Light, brush2) brush3 = QBrush(QColor(38, 38, 255, 255)) brush3.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Midlight, brush3) brush4 = QBrush(QColor(0, 0, 127, 255)) brush4.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Dark, brush4) brush5 = QBrush(QColor(0, 0, 170, 255)) brush5.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Mid, brush5) brush6 = QBrush(QColor(0, 0, 0, 255)) brush6.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Text, brush6) brush7 = QBrush(QColor(255, 255, 255, 255)) brush7.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette.setBrush(QPalette.Active, QPalette.Base, brush7) brush8 = QBrush(QColor(220, 220, 220, 255)) brush8.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Window, brush8) palette.setBrush(QPalette.Active, QPalette.Shadow, brush6) brush9 = QBrush(QColor(10, 95, 137, 255)) brush9.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Active, QPalette.Link, brush6) palette.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) brush10 = QBrush(QColor(232, 232, 232, 255)) brush10.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette.setBrush(QPalette.Inactive, QPalette.Button, brush1) palette.setBrush(QPalette.Inactive, QPalette.Light, brush2) palette.setBrush(QPalette.Inactive, QPalette.Midlight, brush3) palette.setBrush(QPalette.Inactive, QPalette.Dark, brush4) palette.setBrush(QPalette.Inactive, QPalette.Mid, brush5) palette.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette.setBrush(QPalette.Disabled, QPalette.Button, brush1) palette.setBrush(QPalette.Disabled, QPalette.Light, brush2) palette.setBrush(QPalette.Disabled, QPalette.Midlight, brush3) palette.setBrush(QPalette.Disabled, QPalette.Dark, brush4) palette.setBrush(QPalette.Disabled, QPalette.Mid, brush5) palette.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.bslider.setPalette(palette) self.bslider.setMaximum(400) self.bslider.setValue(100) self.bslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.bslider, 6, 1, 1, 1) self.blabel = QLabel(self.GroupBox1) self.blabel.setObjectName(u"blabel") self.gridLayout.addWidget(self.blabel, 6, 2, 1, 1) self.TextLabel2 = QLabel(self.GroupBox1) self.TextLabel2.setObjectName(u"TextLabel2") self.gridLayout.addWidget(self.TextLabel2, 4, 0, 1, 1) self.gslider = QSlider(self.GroupBox1) self.gslider.setObjectName(u"gslider") palette1 = QPalette() palette1.setBrush(QPalette.Active, QPalette.WindowText, brush) brush11 = QBrush(QColor(0, 255, 0, 255)) brush11.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Button, brush11) brush12 = QBrush(QColor(127, 255, 127, 255)) brush12.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Light, brush12) brush13 = QBrush(QColor(38, 255, 38, 255)) brush13.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Midlight, brush13) brush14 = QBrush(QColor(0, 127, 0, 255)) brush14.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Dark, brush14) brush15 = QBrush(QColor(0, 170, 0, 255)) brush15.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Mid, brush15) palette1.setBrush(QPalette.Active, QPalette.Text, brush6) palette1.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Active, QPalette.Base, brush7) palette1.setBrush(QPalette.Active, QPalette.Window, brush8) palette1.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Active, QPalette.Link, brush6) palette1.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette1.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette1.setBrush(QPalette.Inactive, QPalette.Button, brush11) palette1.setBrush(QPalette.Inactive, QPalette.Light, brush12) palette1.setBrush(QPalette.Inactive, QPalette.Midlight, brush13) palette1.setBrush(QPalette.Inactive, QPalette.Dark, brush14) palette1.setBrush(QPalette.Inactive, QPalette.Mid, brush15) palette1.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette1.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette1.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette1.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette1.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette1.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette1.setBrush(QPalette.Disabled, QPalette.Button, brush11) palette1.setBrush(QPalette.Disabled, QPalette.Light, brush12) palette1.setBrush(QPalette.Disabled, QPalette.Midlight, brush13) palette1.setBrush(QPalette.Disabled, QPalette.Dark, brush14) palette1.setBrush(QPalette.Disabled, QPalette.Mid, brush15) palette1.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette1.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette1.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette1.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette1.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.gslider.setPalette(palette1) self.gslider.setMaximum(400) self.gslider.setValue(100) self.gslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.gslider, 4, 1, 1, 1) self.glabel = QLabel(self.GroupBox1) self.glabel.setObjectName(u"glabel") self.gridLayout.addWidget(self.glabel, 4, 2, 1, 1) self.TextLabel7 = QLabel(self.GroupBox1) self.TextLabel7.setObjectName(u"TextLabel7") self.gridLayout.addWidget(self.TextLabel7, 0, 0, 1, 1) self.TextLabel8 = QLabel(self.GroupBox1) self.TextLabel8.setObjectName(u"TextLabel8") self.gridLayout.addWidget(self.TextLabel8, 0, 2, 1, 1) self.gammaslider = QSlider(self.GroupBox1) self.gammaslider.setObjectName(u"gammaslider") palette2 = QPalette() palette2.setBrush(QPalette.Active, QPalette.WindowText, brush) palette2.setBrush(QPalette.Active, QPalette.Button, brush7) palette2.setBrush(QPalette.Active, QPalette.Light, brush7) palette2.setBrush(QPalette.Active, QPalette.Midlight, brush7) brush16 = QBrush(QColor(127, 127, 127, 255)) brush16.setStyle(Qt.SolidPattern) palette2.setBrush(QPalette.Active, QPalette.Dark, brush16) brush17 = QBrush(QColor(170, 170, 170, 255)) brush17.setStyle(Qt.SolidPattern) palette2.setBrush(QPalette.Active, QPalette.Mid, brush17) palette2.setBrush(QPalette.Active, QPalette.Text, brush6) palette2.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Active, QPalette.Base, brush7) palette2.setBrush(QPalette.Active, QPalette.Window, brush8) palette2.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Active, QPalette.Link, brush6) palette2.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette2.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette2.setBrush(QPalette.Inactive, QPalette.Button, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Light, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Midlight, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Dark, brush16) palette2.setBrush(QPalette.Inactive, QPalette.Mid, brush17) palette2.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette2.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette2.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette2.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette2.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette2.setBrush(QPalette.Disabled, QPalette.Button, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Light, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Midlight, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Dark, brush16) palette2.setBrush(QPalette.Disabled, QPalette.Mid, brush17) palette2.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette2.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette2.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette2.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.gammaslider.setPalette(palette2) self.gammaslider.setMaximum(400) self.gammaslider.setValue(100) self.gammaslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.gammaslider, 0, 1, 1, 1) self.TextLabel1_2 = QLabel(self.GroupBox1) self.TextLabel1_2.setObjectName(u"TextLabel1_2") self.gridLayout.addWidget(self.TextLabel1_2, 2, 0, 1, 1) self.rlabel = QLabel(self.GroupBox1) self.rlabel.setObjectName(u"rlabel") self.gridLayout.addWidget(self.rlabel, 2, 2, 1, 1) self.rslider = QSlider(self.GroupBox1) self.rslider.setObjectName(u"rslider") palette3 = QPalette() palette3.setBrush(QPalette.Active, QPalette.WindowText, brush) brush18 = QBrush(QColor(255, 0, 0, 255)) brush18.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Button, brush18) brush19 = QBrush(QColor(255, 127, 127, 255)) brush19.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Light, brush19) brush20 = QBrush(QColor(255, 38, 38, 255)) brush20.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Midlight, brush20) brush21 = QBrush(QColor(127, 0, 0, 255)) brush21.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Dark, brush21) brush22 = QBrush(QColor(170, 0, 0, 255)) brush22.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Mid, brush22) palette3.setBrush(QPalette.Active, QPalette.Text, brush6) palette3.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Active, QPalette.Base, brush7) palette3.setBrush(QPalette.Active, QPalette.Window, brush8) palette3.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Active, QPalette.Link, brush6) palette3.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette3.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette3.setBrush(QPalette.Inactive, QPalette.Button, brush18) palette3.setBrush(QPalette.Inactive, QPalette.Light, brush19) palette3.setBrush(QPalette.Inactive, QPalette.Midlight, brush20) palette3.setBrush(QPalette.Inactive, QPalette.Dark, brush21) palette3.setBrush(QPalette.Inactive, QPalette.Mid, brush22) palette3.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette3.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette3.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette3.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette3.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette3.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette3.setBrush(QPalette.Disabled, QPalette.Button, brush18) palette3.setBrush(QPalette.Disabled, QPalette.Light, brush19) palette3.setBrush(QPalette.Disabled, QPalette.Midlight, brush20) palette3.setBrush(QPalette.Disabled, QPalette.Dark, brush21) palette3.setBrush(QPalette.Disabled, QPalette.Mid, brush22) palette3.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette3.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette3.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette3.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette3.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.rslider.setPalette(palette3) self.rslider.setMaximum(400) self.rslider.setValue(100) self.rslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.rslider, 2, 1, 1, 1) self.PushButton3 = QPushButton(self.GroupBox1) self.PushButton3.setObjectName(u"PushButton3") self.gridLayout.addWidget(self.PushButton3, 8, 0, 1, 3) self.MyCustomWidget1 = GammaView(self.GroupBox1) self.MyCustomWidget1.setObjectName(u"MyCustomWidget1") self.gridLayout.addWidget(self.MyCustomWidget1, 0, 3, 9, 1) self.vboxLayout.addWidget(self.GroupBox1) self.hboxLayout3 = QHBoxLayout() self.hboxLayout3.setSpacing(6) self.hboxLayout3.setObjectName(u"hboxLayout3") self.hboxLayout3.setContentsMargins(0, 0, 0, 0) self.spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.hboxLayout3.addItem(self.spacerItem1) self.buttonOk = QPushButton(Config) self.buttonOk.setObjectName(u"buttonOk") self.buttonOk.setAutoDefault(True) self.hboxLayout3.addWidget(self.buttonOk) self.buttonCancel = QPushButton(Config) self.buttonCancel.setObjectName(u"buttonCancel") self.buttonCancel.setAutoDefault(True) self.hboxLayout3.addWidget(self.buttonCancel) self.vboxLayout.addLayout(self.hboxLayout3) self.retranslateUi(Config) self.size_width.valueChanged.connect(self.size_custom.click) self.size_height.valueChanged.connect(self.size_custom.click) self.buttonOk.setDefault(True) QMetaObject.connectSlotsByName(Config)
def __init__(self, redvox_config: Optional[RedVoxConfig], parent=None): super(ServerSelectionWidget, self).__init__(parent) int_validator = QIntValidator() self.https: QRadioButton = QRadioButton() self.https.setText("HTTPS") self.http: QRadioButton = QRadioButton() self.http.setText("HTTP") self.host: QLineEdit = QLineEdit() self.port: QLineEdit = QLineEdit() self.port.setValidator(int_validator) self.timeout: QLineEdit = QLineEdit() self.retries: QLineEdit = QLineEdit() self.timeout.setValidator(int_validator) self.retries.setValidator(int_validator) self.disable_timing_correction: QCheckBox = QCheckBox() if redvox_config is not None: self.host.setText(redvox_config.host) self.port.setText(str(redvox_config.port)) if redvox_config.protocol == "http": self.http.setChecked(True) else: self.https.setChecked(True) else: self.https.setChecked(True) self.host.setText("redvox.io") self.port.setText("8080") self.timeout.setText("120") self.retries.setText("3") self.disable_timing_correction.setText("Disable Timing Correction") self.disable_timing_correction.setChecked(False) layout: QVBoxLayout = QVBoxLayout() server_widget: QWidget = QWidget() server_options_widget: QWidget = QWidget() server_layout: QHBoxLayout = QHBoxLayout() server_options_layout: QHBoxLayout = QHBoxLayout() server_widget.setLayout(server_layout) server_options_widget.setLayout(server_options_layout) server_layout.addWidget(QLabel("Protocol")) server_layout.addWidget(self.https) server_layout.addWidget(self.http) server_layout.addWidget(QLabel("Host")) server_layout.addWidget(self.host) server_layout.addWidget(QLabel("Port")) server_layout.addWidget(self.port) server_options_layout.addWidget(QLabel("Timeout")) server_options_layout.addWidget(self.timeout) server_options_layout.addWidget(QLabel("Retries")) server_options_layout.addWidget(self.retries) server_options_layout.addWidget(self.disable_timing_correction) layout.addWidget(server_widget) layout.addWidget(server_options_widget) self.setLayout(layout)