def _create_vertical_line(): vertical_line = QFrame() vertical_line.setFixedWidth(20) vertical_line.setFrameShape(QFrame.VLine) vertical_line.setFrameShadow(QFrame.Sunken) vertical_line.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) vertical_line.setMinimumHeight(300) return vertical_line
def layouts(self): self.mainLayout = QVBoxLayout() self.topLayout = QHBoxLayout() self.bottomLayout = QFormLayout() self.bottomLayout.setVerticalSpacing(20) self.bottomBtnLayout = QHBoxLayout() # Put elements into frames for visual distinction self.topFrame = QFrame() self.bottomFrame = QFrame() # Add widgets to top layout # self.topLayout.addWidget(self.addFacilityImg) self.topLayout.addWidget(self.titleText) self.topFrame.setLayout(self.topLayout) # Add widgets to middle layout self.bottomLayout.addWidget(self.facilityInfoTitleText) self.bottomLayout.addRow(QLabel("Facility name: "), self.facilityNameEntry) self.bottomLayout.addRow(QLabel("Location: "), self.facilityLocationEntry) self.bottomLayout.addRow(QLabel("Phone: "), self.facilityPhoneEntry) self.bottomLayout.addRow(QLabel("Email: "), self.facilityEmailEntry) self.bottomLayout.addRow(QLabel("Facility supervisor: "), self.facilitySupervisorEntry) self.bottomLayout.addRow(QLabel(""), self.attachPhotoBtn) self.bottomBtnLayout.addWidget(self.cancelBtn) self.bottomBtnLayout.addItem( QSpacerItem(200, 5, QSizePolicy.Minimum, QSizePolicy.Expanding)) self.bottomBtnLayout.addWidget(self.addFacilityBtn) self.bottomBtnLayout.setAlignment(Qt.AlignBottom) self.bottomLayout.addRow(self.bottomBtnLayout) self.bottomFrame.setLayout(self.bottomLayout) # Add frames to main layout self.mainLayout.addWidget(self.topFrame) self.mainLayout.addWidget(self.bottomFrame) self.setLayout(self.mainLayout)
def _init_widgets(self): self.resize(530, 180) main_layout = QVBoxLayout() frame = QFrame() frame.setFrameShape(QFrame.NoFrame) frame.setFrameShadow(QFrame.Plain) frameLayout = QVBoxLayout() self.connectRad = QRadioButton(frame) self.createRad = QRadioButton(frame) self.connectRad.setChecked(True) self.connectRad.toggled.connect(self.handleRadioButtons) self.createRad.toggled.connect(self.handleRadioButtons) frameLayout.addWidget(self.connectRad) internalFrame = QFrame() internalFrameLayout = QHBoxLayout(internalFrame) hostLabel = QLabel() portLabel = QLabel() self.hostText = QLineEdit() self.portText = QLineEdit() internalFrameLayout.addWidget(hostLabel) internalFrameLayout.addWidget(self.hostText) internalFrameLayout.addWidget(portLabel) internalFrameLayout.addWidget(self.portText) self.portText.setMaximumSize(QSize(80, 200)) internalFrame.setLayout(internalFrameLayout) frameLayout.addWidget(internalFrame) frameLayout.addWidget(self.createRad) frame.setLayout(frameLayout) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) main_layout.addWidget(frame) main_layout.addWidget(self.buttonBox) self.setLayout(main_layout) self.setWindowTitle("Cartprograph Connect") self.connectRad.setText("Connect to Existing Cartprograph Server") self.createRad.setText("Create New Cartprograph Server") hostLabel.setText("Host") portLabel.setText("Port")
def test_GIVEN_translation_WHEN_getting_transformation_frame_THEN_frame_type_is_edit_translation( qtbot, ): frame = QFrame() frame.setLayout(QVBoxLayout()) value = create_transformation(TransformationType.TRANSLATION) qtbot.addWidget(frame) get_transformation_frame(frame, None, value) assert isinstance(frame.transformation_frame, EditTranslation)
def close_patch(self): """Close the current patch.""" if self.patch: close_patch(self.patch) self.patch = None self.setCentralWidget(QFrame()) self.setWindowTitle('patchbay') self.actions['close'].setDisabled(True)
def test_GIVEN_invalid_transformation_type_WHEN_getting_transformation_frame_THEN_runtime_error_is_thrown( qtbot, ): frame = QFrame() frame.setLayout(QVBoxLayout()) value = create_transformation("asdf") qtbot.addWidget(frame) with pytest.raises(RuntimeError): get_transformation_frame(frame, None, value)
def __init__(self, data_list, header, *args): QWidget.__init__(self, *args) # setGeometry(x_pos, y_pos, width, height) self.setGeometry(300, 200, 570, 450) self.setWindowTitle('Click on column title to sort') # Setup the models and view self.tmodel = MyTableModel(self, data_list, header) # actual model self.pmodel = MySortingProxyModel() # proxy model for sorting self.pmodel.setSourceModel(self.tmodel) # assign actual model to the proxy self.tview = MyTableView() self.tview.setModel(self.pmodel) # assign the proxy to the view self.tview.resizeColumnsToContents() # set col widths based on model data self.tview.model().dataChanged.connect(self.tview.resize_cols) # resize cols when data changes # Setup the entry fields entry_frame = QFrame(self) entry_layout = QHBoxLayout(entry_frame) name_edit = QLineEdit(entry_frame) x_edit = QLineEdit(entry_frame) z_edit = QLineEdit(entry_frame) y_edit = QLineEdit(entry_frame) type_edit = QLineEdit(entry_frame) biome_edit = QLineEdit(entry_frame) notes_edit = QLineEdit(entry_frame) add_btn = QPushButton('Add') del_btn = QPushButton('Remove') self.entry_fields = [] self.entry_fields.append(name_edit) self.entry_fields.append(x_edit) self.entry_fields.append(z_edit) self.entry_fields.append(y_edit) self.entry_fields.append(type_edit) self.entry_fields.append(biome_edit) self.entry_fields.append(notes_edit) add_btn.clicked.connect(self.on_add_clicked) del_btn.clicked.connect(self.on_del_clicked) entry_layout.addWidget(name_edit) entry_layout.addWidget(x_edit) entry_layout.addWidget(z_edit) entry_layout.addWidget(y_edit) entry_layout.addWidget(type_edit) entry_layout.addWidget(biome_edit) entry_layout.addWidget(notes_edit) entry_layout.addWidget(add_btn) entry_layout.addWidget(del_btn) # Setup the main layout layout = QVBoxLayout(self) layout.addWidget(entry_frame) layout.addWidget(self.tview) self.setLayout(layout)
def close_configuration(self): try: self.config.close() except AttributeError: pass self.config = None self.setCentralWidget(QFrame()) self.current_configuration = None
def initContentFrame(self): self.contentFrame = QFrame() self.contentFrame.setContentsMargins(0, 0, 0, 0) self.contentLayout = QVBoxLayout() self.contentLayout.setContentsMargins(0, 0, 0, 0) self.contentLayout.setSpacing(0) self.contentFrame.setLayout(self.contentLayout) self.mainLayout.addWidget(self.contentFrame)
def _init_simgrs_tab(self, tab): # simgrs list simgrs_label = QLabel(self) simgrs_label.setText('Simulation Manager') simgrs_list = QComboBox(self) self._simgrs_list = simgrs_list simgrs_list.currentIndexChanged.connect(self._on_simgr_selection) pg_layout = QHBoxLayout() pg_layout.addWidget(simgrs_label) pg_layout.addWidget(simgrs_list) # simulation manager information viewer = QSimulationManagerViewer(self.simgr) self._simgr_viewer = viewer viewer.currentItemChanged.connect(self._on_state_selection) # # Buttons # # step button step_button = QPushButton() step_button.setText('Step actives') step_button.released.connect(self._on_step_clicked) # step until branch step_until_branch_button = QPushButton('Step actives until branch') step_until_branch_button.released.connect( self._on_step_until_branch_clicked) # explore button explore_button = QPushButton('Explore') explore_button.released.connect(self._on_explore_clicked) # buttons layout buttons_layout = QVBoxLayout() layout = QHBoxLayout() layout.addWidget(explore_button) buttons_layout.addLayout(layout) layout = QHBoxLayout() layout.addWidget(step_button) layout.addWidget(step_until_branch_button) buttons_layout.addLayout(layout) simgrs_layout = QVBoxLayout() simgrs_layout.addLayout(pg_layout) simgrs_layout.addWidget(viewer) simgrs_layout.addLayout(buttons_layout) frame = QFrame() frame.setLayout(simgrs_layout) tab.addTab(frame, 'General')
def __init__(self): QWidget.__init__(self) self.items = 0 # Left self.table = QTableWidget() self.table.setColumnCount(2) self.table.setHorizontalHeaderLabels(["Status Code", "URL"]) self.table.horizontalHeader().setStretchLastSection(True) self.table.clicked.connect(self.item_clicked) # Right self.url_label = QLabel("Enter URL:") self.url_label.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Fixed) self.url_input = QLineEdit() self.wordlist_path = "wordlists/dir.txt" self.wl_label = QLabel(f"Wordlist (path): {self.wordlist_path}") self.wl_label.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Fixed) self.open_wl_btn = QPushButton("Open wordlist") self.process_btn = QPushButton("Process") self.clear_btn = QPushButton("Clear") self.quit_btn = QPushButton("Quit") self.process_btn.setEnabled(False) # Creating layout self.right = QVBoxLayout() self.right.setMargin(10) # Right Widgets self.right.addWidget(self.url_label) self.right.addWidget(self.url_input) self.right.addWidget(self.wl_label) self.right.addWidget(self.open_wl_btn) self.right.addWidget(QFrame()) self.right.addWidget(self.process_btn) self.right.addWidget(self.clear_btn) self.right.addWidget(self.quit_btn) # QWidget Layout self.layout = QHBoxLayout() self.layout.addWidget(self.table) self.layout.addLayout(self.right) # Set the layout to the QWidget self.setLayout(self.layout) # Signals and Slots self.process_btn.clicked.connect(self.start_scan) self.quit_btn.clicked.connect(self.quit_application) self.clear_btn.clicked.connect(self.clear_table) self.url_input.textChanged[str].connect(self.check_disable) self.open_wl_btn.clicked.connect(self.open_file_dialog)
def build_ui(self): self.setGeometry(50, 50, 450, 300) self.setMinimumSize(400, 300) self.setWindowTitle('Spore Reporter') layout = QVBoxLayout() # self.err_wdg = QWidget() # err_layout = QHBoxLayout(self.err_wdg) # layout.addWidget(err_wdg) # # err_lbl = 'Ops..\nSpore seems to have caused an error.\n' info_msg = 'Help to improve Spore by anonymously submitting your logs' self.info_lbl = QLabel(info_msg) layout.addWidget(self.info_lbl) self.address_edt = QLineEdit() self.address_edt.setPlaceholderText('E-Mail Address (optional)') layout.addWidget(self.address_edt) self.subject_edt = QLineEdit() self.subject_edt.setPlaceholderText('Subject (optional)') layout.addWidget(self.subject_edt) self.msg_edt = QTextEdit() self.msg_edt.setPlaceholderText('Message (optional)') self.msg_edt.setFixedHeight(60) layout.addWidget(self.msg_edt) self.log_edt = QTextEdit() self.log_edt.setReadOnly(True) self.log_edt.setLineWrapMode(QTextEdit.NoWrap) layout.addWidget(self.log_edt) ctrl_layout = QGridLayout() layout.addLayout(ctrl_layout) self.submit_btn = QPushButton('Submit') ctrl_layout.addWidget(self.submit_btn, 0, 0, 1, 1) self.cancel_btn = QPushButton('Cancel') ctrl_layout.addWidget(self.cancel_btn, 0, 1, 1, 1) line = QFrame() line.setFrameShape(QFrame.HLine) line.setFrameShadow(QFrame.Sunken) ctrl_layout.addWidget(line, 1, 0, 1, 2) self.disable_btn = QPushButton('Disable Reporter') ctrl_layout.addWidget(self.disable_btn, 2, 0, 1, 1) self.auto_btn = QPushButton('Send Reports Automatically') ctrl_layout.addWidget(self.auto_btn, 2, 1, 1, 1) self.setLayout(layout)
def buildUI(self): self.closeButton = QPushButton('close') self.closeButton.setShortcut('Ctrl+W') self.closeButton.clicked.connect(self.onClose) self.closeButton.setFixedSize(0, 0) self.mainWrapperLayout = QVBoxLayout() self.mainWrapperLayout.addWidget(self.closeButton) self.divider1 = QFrame() self.divider1.setFrameShape(QFrame.HLine) self.divider1.setFrameShadow(QFrame.Sunken) self.divider2 = QFrame() self.divider2.setFrameShape(QFrame.HLine) self.divider2.setFrameShadow(QFrame.Sunken) self.headerLayout = self.buildHeader() self.optionsLayout = self.buildOptionsLayout() self.statusTextScroll = QScrollArea() self.statusTextScroll.setWidgetResizable(True) self.statusWidget = QWidget() self.statusTextScroll.setWidget(self.statusWidget) self.statusText = QVBoxLayout(self.statusWidget) self.statusTextScroll.setContentsMargins(0, 0, 0, 50) self.statusWidget.setLayout(self.statusText) self.mainWrapperLayout.addLayout(self.headerLayout) self.mainWrapperLayout.addWidget(self.divider1) self.mainWrapperLayout.addLayout(self.optionsLayout) self.mainWrapperLayout.addWidget(self.divider2) self.mainWrapperLayout.addWidget(self.statusTextScroll) self.startButton = QPushButton('Go') self.startButton.clicked.connect(self.onStartClick) self.mainWrapperLayout.addWidget(self.startButton) self.setLayout(self.mainWrapperLayout) self.setMinimumWidth(450)
def define_sections(self): """reimplement this to define all your sections and add them as (title, widget) tuples to self.sections """ widget = QFrame(self.tree) layout = QHBoxLayout(widget) layout.addWidget(QLabel("Bla")) layout.addWidget(QLabel("Blubb")) title = "Section 1" self.sections.append((title, widget))
def initUI(self): col = QColor(0, 0, 0) self.btn = QPushButton('色の選択', self) self.btn.move(20, 20) self.btn.clicked.connect(self.showDialog) self.frm = QFrame(self) self.frm.setStyleSheet("QWidget { background-color: %s }" % col.name()) self.frm.setGeometry(130, 20, 100, 100)
def __init__(self): super(MainWindow, self).__init__() # include components self.titleBar = CustomBar(self) self.sidBar = SideBar() self.container = pagesWidget() # line Decoration line1 = QFrame() line1.setStyleSheet("background-color: #FFB300;") line1.setObjectName("Vline") line1.setMinimumHeight(2) # Main window layout mainLayout = QVBoxLayout() mainLayout.setContentsMargins(0, 0, 0, 0) mainLayout.setSpacing(0) # custom bar layout TitleBarLayout = QVBoxLayout() TitleBarLayout.setContentsMargins(0, 0, 0, 0) TitleBarLayout.addWidget(self.titleBar) TitleBarLayout.addWidget(line1) mainLayout.addLayout(TitleBarLayout) BodyContentLayout = QHBoxLayout() BodyContentLayout.addWidget(self.sidBar) BodyContentLayout.addWidget(self.container) BodyContentLayout.setContentsMargins(0, 0, 0, 0) mainLayout.addLayout(BodyContentLayout) # Set Minimum size of window self.setMinimumSize(700, 500) # Get Frame less window self.setWindowFlags(Qt.FramelessWindowHint | Qt.CustomizeWindowHint) # Create Widget to add Layout widget = QWidget() widget.setLayout(mainLayout) self.setCentralWidget(widget) # Database Status label_db = QLabel() self.container.db_status.setText("No Database Connection!") self.container.horizontalLayout_db_btn.addWidget(label_db) # Buttons Clicked Signal self.titleBar.btn_close.clicked.connect(self.close) self.titleBar.btn_max.clicked.connect(self.windowResize) self.titleBar.btn_min.clicked.connect(self.showMinimized) self.sidBar.DataBase.clicked.connect(self.setCustomersPage) self.sidBar.About.clicked.connect(self.setAboutPage)
def __init__(self, widget): QFrame.__init__(self, widget) self.setGeometry(QRect(0, 0, 800, 480)) self.setStyleSheet( "font: 24pt 배달의민족 주아;" "background-color: rgba(0, 0, 0, 100);" ) self.dialog = QFrame(self) self.dialog.setGeometry(QRect(200, 120, 400, 240)) self.dialog.setStyleSheet("background-color: white;" "border-radius: 25px;")
def _init_avoids_tab(self, tab): avoids_list = QListWidget() self._avoids_list = avoids_list layout = QVBoxLayout() layout.addWidget(avoids_list) frame = QFrame() frame.setLayout(layout) tab.addTab(frame, 'Avoids')
def _init_widgets(self): if self._state.am_none(): return if self._state.arch.name not in self.ARCH_REGISTERS: l.error( "Architecture %s is not listed in QRegisterViewer.ARCH_REGISTERS.", self._state.arch.name) return layout = QVBoxLayout() area = QScrollArea() area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) area.setWidgetResizable(True) regs = self.ARCH_REGISTERS[self._state.arch.name] # common ones common_regs = regs['common'] for reg_name in common_regs: sublayout = QHBoxLayout() lbl_reg_name = QLabel(self) lbl_reg_name.setProperty('class', 'reg_viewer_label') lbl_reg_name.setText(reg_name) lbl_reg_name.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sublayout.addWidget(lbl_reg_name) sublayout.addSpacing(10) reg_value = QASTViewer(None, parent=self, workspace=self.workspace) self._registers[reg_name] = reg_value sublayout.addWidget(reg_value) layout.addLayout(sublayout) layout.setSpacing(0) layout.addStretch(0) layout.setContentsMargins(2, 2, 2, 2) # the container container = QFrame() container.setAutoFillBackground(True) palette = container.palette() palette.setColor(container.backgroundRole(), Qt.white) container.setPalette(palette) container.setLayout(layout) area.setWidget(container) base_layout = QVBoxLayout() base_layout.addWidget(area) self.setLayout(base_layout)
def _setup_ui(self): # Set up our basic layout layout = QHBoxLayout(self) self.setLayout(layout) layout.setSpacing(3) layout.setMargin(1) bit_frame = QFrame(self) layout.addWidget(bit_frame) bit_layout = QGridLayout(bit_frame) bit_layout.setSpacing(1) bit_layout.setMargin(0) bit_frame.setLayout(bit_layout) bit_frame.setFrameStyle(QFrame.StyledPanel | QFrame.Raised) col = 0 col = self._create_reg(bit_frame, bit_layout, col, 16, self._w_cmp_switches, self._w_ign_switches, self._update_val_box, self._send_ign_val) sep = QFrame(bit_frame) sep.setFrameStyle(QFrame.VLine | QFrame.Raised) bit_layout.addWidget(sep, 0, col, 2, 1) self._create_reg(bit_frame, bit_layout, col + 1, 2, self._par_cmp_switches, self._par_ign_switches, self._send_parity, self._send_parity) # Create a value box for displaying the overall decoded valess self._val_box = QLineEdit(self) layout.addWidget(self._val_box) self._val_box.setMaximumSize(52, 32) self._val_box.setText('00000') self._val_box.setValidator(RegValidator(0o77777)) self._val_box.returnPressed.connect(self._update_cmp_switches) font = QFont('Monospace') font.setStyleHint(QFont.TypeWriter) font.setPointSize(10) self._val_box.setFont(font) self._val_box.setAlignment(Qt.AlignCenter) # Add some spacing to account for lack of parity indicators layout.addSpacing(40)
def layouts(self): self.mainLayout = QVBoxLayout() self.topLayout = QHBoxLayout() self.bottomLayout = QFormLayout() self.bottomLayout.setVerticalSpacing(20) self.bottomBtnLayout = QHBoxLayout() # Put elements into frames for visual distinction self.topFrame = QFrame() self.bottomFrame = QFrame() # Add widgets to top layout # self.topLayout.addWidget(self.addPersonImg) self.topLayout.addWidget(self.titleText) self.topFrame.setLayout(self.topLayout) # Add widgets to middle layout self.bottomLayout.addRow(QLabel("First name: "), self.firstNameEntry) self.bottomLayout.addRow(QLabel("Last name: "), self.lastNameEntry) self.bottomLayout.addRow(QLabel("Title: "), self.titleEntry) self.bottomLayout.addRow(QLabel("Phone: "), self.phoneEntry) self.bottomLayout.addRow(QLabel("Email: "), self.emailEntry) self.bottomLayout.addRow(QLabel("Location: "), self.locationEntry) self.bottomLayout.addRow(QLabel("Employment type: "), self.employmentTypeEntry) self.bottomLayout.addRow(QLabel(""), self.attachPhotoBtn) self.bottomBtnLayout.addWidget(self.cancelBtn) self.bottomBtnLayout.addItem(QSpacerItem(200, 5, QSizePolicy.Minimum, QSizePolicy.Expanding)) self.bottomBtnLayout.addWidget(self.addPersonBtn) self.bottomBtnLayout.setAlignment(Qt.AlignBottom) self.bottomLayout.addRow(self.bottomBtnLayout) self.bottomFrame.setLayout(self.bottomLayout) # Add frames to main layout self.mainLayout.addWidget(self.topFrame) self.mainLayout.addWidget(self.bottomFrame) self.setLayout(self.mainLayout)
def setUp_UI(self): self.image = Image_Widget(self) self.line = QFrame() self.line.setFrameShape(QFrame.VLine) self.line.setFrameShadow(QFrame.Sunken) self.login = Login_Widget(self) self.layout = QHBoxLayout() self.layout.addWidget(self.image) self.layout.addWidget(self.line) self.layout.addWidget(self.login) self.setLayout(self.layout)
def __init__(self): QWidget.__init__(self) self.Main_Layout = QHBoxLayout() self.Child_1 = Layout_Child_1() self.Child_2 = Layout_Child_2() self.Main_Layout.addWidget(self.Child_1) self.line = QFrame() self.line.setFrameShape(QFrame.VLine) self.line.setFrameShadow(QFrame.Sunken) self.Main_Layout.addWidget(self.line) self.Main_Layout.addWidget(self.Child_2) self.setLayout(self.Main_Layout)
def __init__(self): super(LimitOptionsView, self).__init__() self.layout = QVBoxLayout() self.title = QLabel(prefs.TITLE) self.frame_layout = QHBoxLayout() self.frame = QFrame() self.limit_type_cb = QCheckBox(prefs.LIMIT) self.limit_type = QLineEdit(prefs.LIMIT_DEFAULT) self.search_cb = QCheckBox(prefs.SEARCH) self.search = QLineEdit(prefs.SEARCH_DEFAULT) self._configure()
def layouts(self): self.mainLayout = QVBoxLayout() self.topLayout = QVBoxLayout() self.bottomLayout = QFormLayout() self.topFrame = QFrame() self.bottomFrame = QFrame() # Add widgets self.topLayout.addWidget(self.titleText) self.topLayout.addWidget(self.issueImg) self.topFrame.setLayout(self.topLayout) self.bottomLayout.addRow("ID: ", self.idEntry) self.bottomLayout.addRow("Date: ", self.dateEntry) self.bottomLayout.addRow("Priority: ", self.priorityEntry) self.bottomLayout.addRow("Observer: ", self.observerEntry) self.bottomLayout.addRow("Revision Team: ", self.revTeamEntry) self.bottomLayout.addRow("Inspector name: ", self.inspectionNameEntry) self.bottomLayout.addRow("HSE theme: ", self.themeEntry) self.bottomLayout.addRow("Facility: ", self.facilityEntry) self.bottomLayout.addRow("Facility supervisor: ", self.facilitySupervisorEntry) self.bottomLayout.addRow("Specific location: ", self.specLocationEntry) self.bottomLayout.addRow("Inspected department: ", self.inspectedDeptEntry) self.bottomLayout.addRow("Inspected contractor: ", self.inspectedContrEntry) self.bottomLayout.addRow("Inspected subcontractor: ", self.inspectedSubcontrEntry) self.bottomLayout.addRow("Deadline: ", self.deadlineEntry) self.bottomLayout.addRow("Status: ", self.statusEntry) self.bottomLayout.addRow("", self.updateBtn) self.bottomLayout.addRow("", self.deleteBtn) self.bottomFrame.setLayout(self.bottomLayout) self.mainLayout.addWidget(self.topFrame) self.mainLayout.addWidget(self.bottomFrame) self.setLayout(self.mainLayout)
def _init_settings_tab(self, tab): oneactive_checkbox = QCheckBox("Keep at most one active path") oneactive_checkbox.setChecked(False) self._oneactive_checkbox = oneactive_checkbox settings_layout = QVBoxLayout() settings_layout.addWidget(oneactive_checkbox) settings_layout.addStretch(0) frame = QFrame() frame.setLayout(settings_layout) tab.addTab(frame, 'Settings')
def __init__(self): QWidget.__init__(self) myColor = QColor(0, 0, 0) self.myButton = QPushButton('Press to Change Color', self) self.myButton.move(10, 50) self.myButton.clicked.connect(self.showColorDialog) self.myFrame = QFrame(self) self.myFrame.setStyleSheet("QWidget { background-color: %s }" % myColor.name()) self.myFrame.setGeometry(130, 22, 100, 100) self.setGeometry(300, 300, 250, 180) self.setWindowTitle('Color Dialog - Example') self.show()
def initOtherButtons(self, flags): # other action buttons if len(self.button_list) != 0: self.separator1 = QFrame(self) self.separator1.setFrameShape(QFrame.VLine) self.separator1.setFrameShadow(QFrame.Sunken) self.hlayout.addWidget(self.separator1) self.undoButton = QPushButton(self) self.undoButton.setIcon(QIcon(":/resource/icon/undo.png")) self.undoButton.setFixedSize(self.iconWidth, self.iconWidth) self.undoButton.clicked.connect(self.otherButtonsClicked) self.hlayout.addWidget(self.undoButton) if flags & constant.SAVE_TO_FILE: self.saveButton = QPushButton(self) self.saveButton.setIcon(QIcon(":/resource/icon/save.png")) self.saveButton.setFixedSize(self.iconWidth, self.iconHeight) self.saveButton.clicked.connect(self.otherButtonsClicked) self.hlayout.addWidget(self.saveButton) self.separator2 = QFrame(self) self.separator2.setFrameShape(QFrame.VLine) self.separator2.setFrameShadow(QFrame.Sunken) self.hlayout.addWidget(self.separator2) self.cancelButton = QPushButton(self) self.cancelButton.setIcon(QIcon(":/resource/icon/close.png")) self.cancelButton.setFixedSize(self.iconWidth, self.iconHeight) self.cancelButton.clicked.connect(self.otherButtonsClicked) if flags & constant.CLIPBOARD: self.okButton = QPushButton(self) self.okButton.setIcon(QIcon(":/resource/icon/check.png")) self.okButton.setFixedSize(self.iconWidth, self.iconHeight) self.okButton.clicked.connect(self.otherButtonsClicked) self.hlayout.addWidget(self.okButton) self.hlayout.addWidget(self.cancelButton)
def _reset_ui(self): """Remove all metadata rows and reset the layout.""" table = QFrame() table.setLayout(QFormLayout()) self.table = table.layout() self.setWidgetResizable(True) self.setWidget(table) self.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.MinimumExpanding) self.updateGeometry()
def _init_finds_tab(self, tab): finds_list = QListWidget() self._finds_list = finds_list layout = QVBoxLayout() layout.addWidget(finds_list) frame = QFrame() frame.setLayout(layout) tab.addTab(frame, 'Finds') self._finds_list.itemChanged.connect(self._on_explore_addr_changed)