def __init__( self, parent: QWidget, layout: QHBoxLayout, resource_database: ResourceDatabase, item: ResourceRequirement, ): self.parent = parent self.layout = layout self.resource_database = resource_database self.resource_type_combo = _create_resource_type_combo( item.resource.resource_type, parent) self.resource_type_combo.setMinimumWidth(75) self.resource_type_combo.setMaximumWidth(75) self.resource_name_combo = _create_resource_name_combo( self.resource_database, item.resource.resource_type, item.resource, self.parent) self.negate_combo = QComboBox(parent) self.negate_combo.addItem("≥", False) self.negate_combo.addItem("<", True) self.negate_combo.setCurrentIndex(int(item.negate)) self.negate_combo.setMinimumWidth(40) self.negate_combo.setMaximumWidth(40) self.amount_edit = QLineEdit(parent) self.amount_edit.setValidator(QIntValidator(1, 10000)) self.amount_edit.setText(str(item.amount)) self.amount_edit.setMinimumWidth(45) self.amount_edit.setMaximumWidth(45) self.layout.addWidget(self.resource_type_combo) self.layout.addWidget(self.resource_name_combo) self.layout.addWidget(self.negate_combo) self.layout.addWidget(self.amount_edit) self.resource_type_combo.currentIndexChanged.connect(self._update_type)
def __init__(self, parent=None): super(Form, self).__init__(parent) self.setWindowTitle("Qt Layout example") self.setMinimumWidth(500) # Create widgets self.led = QLineEdit() self.led.setPlaceholderText("write your name here") self.butt_greet = QPushButton("Say Hello") self.butt_close = QPushButton("Close") # Create layout and add widgets layout = QVBoxLayout() layout.addWidget(self.led) layout.addWidget(self.butt_greet) layout.addWidget(self.butt_close) # Set layout self.setLayout(layout) # Add button signal to greetings slot self.butt_greet.clicked.connect(self.greetings) self.butt_close.clicked.connect(self.close)
def __init__(self, columns: List[str], callback: FunctionType): super().__init__() self.setupUi(self) self.onClose_callback = callback self.pressed_add_button = False self.pushButton.clicked.connect(self.add_btn_clicked) for column_name in columns: label = QLabel(self) label.setObjectName(f"{column_name}_label") label.setAlignment(Qt.AlignCenter) label.setText(f"{column_name} = ") edit = QLineEdit(self) edit.setObjectName(f"{column_name}_edit") hlayout = QHBoxLayout(self) hlayout.setObjectName(f"{column_name}_layout") hlayout.addWidget(label) hlayout.addWidget(edit) # hlayout.itemAt(1).widget().childAt(0).text() self.data_layout.addLayout(hlayout)
def __init__(self, parent=None): super().__init__(parent) self.setWindowTitle("My Form") # create widgets We are going to create two widgets: a QLineEdit where # users can enter their name, and a QPushButton that prints the contents # of the QLineEdit. So, let’s add the following code to the init() # method of our Form: self.edit = QLineEdit("Write my name here…") self.button = QPushButton("Show Greetings") # create layout and add widgets Qt comes with layout-support that helps # you organize the widgets in your application. In this case, let’s use # QVBoxLayout to lay out the widgets vertically. Add the following code # to the init() method, after creating the widgets: layout = QVBoxLayout() layout.addWidget(self.edit) layout.addWidget(self.button) # set dialog layout self.setLayout(layout) # Add button signal to greetings slot self.button.clicked.connect(self.greetings)
def __create_line_label(self, name, label, min_width=200, echo_mode=False): """__create_line_label will create a line edit button and his label Arguments: name {str} -- Default value label {str} -- Label name min_width {int} -- Minium width (default: {200}) echo_mode {bool} -- Stars for password (default: {False}) Returns: Tuple[Dict, Dict] -- Line Edit, Label """ line_edit = QLineEdit(name) line_edit.setMinimumWidth(min_width) if echo_mode: line_edit.setEchoMode(QLineEdit.Password) label = QLabel(label) label.setBuddy(line_edit) return line_edit, label
def __init__(self): super(SpiderGui, self).__init__() self.regex = re.compile("[\/\\\:\*\?\"\<\>\|]") self.p = None self.setWindowTitle('开始窗口') self.resize(500, 400) self.domain_line = QLineEdit(self) self.browse_box = QPushButton("浏览") self.log_browser = QTextBrowser(self) # 日志输出框 self.crawl_btn = QPushButton('开始爬取', self) # 开始爬取按钮 self.crawl_btn.clicked.connect(self.crawl_slot) self.browse_box.clicked.connect(self.save_addr) self.save_dir = QLabel("") self.site = QCheckBox("爬取快照") self.inspect = QCheckBox("检测站点") self.handle = QCheckBox("处理已有站点") self.h_layout1 = QHBoxLayout() self.h_layout1.addWidget(QLabel('请输入域名:')) self.h_layout1.addWidget(self.domain_line) self.h_layout2 = QHBoxLayout() self.h_layout2.addWidget(QLabel('保存路径:')) self.h_layout2.addWidget(self.save_dir) self.h_layout2.addWidget(self.browse_box) self.h_layout2.addWidget(self.site) self.h_layout2.addWidget(self.inspect) self.h_layout2.addWidget(self.handle) self.v_layout = QVBoxLayout() self.v_layout.addLayout(self.h_layout1) self.v_layout.addLayout(self.h_layout2) self.v_layout.addWidget(QLabel('日志输出框')) self.v_layout.addWidget(self.log_browser) self.v_layout.addWidget(self.crawl_btn) self.setLayout(self.v_layout) self.Q = Manager().Queue() self.log_thread = LogThread(self)
def __init__(self, parent=None): super(Form, self).__init__(parent) # Create widgets self.title = QLabel("Junkfile", self) self.title.setStyleSheet( "color:#072120; font-weight: bold; font-size: 16px;") self.title.setAlignment(Qt.AlignCenter | Qt.AlignCenter) self.instruction = QLabel("Choose a directory folder:", self) self.edit = QLineEdit("Path...") self.edit.setReadOnly(True) self.button = QPushButton("Open ...") self.copy = QCheckBox("Would you like to make a copy?") self.arrange = QPushButton("Arrange") # Create layout layout = QGridLayout() layout.setColumnMinimumWidth(0, 400) # add widgets layout.addWidget(self.title, 0, 0, 1, 0, Qt.AlignCenter) layout.addWidget(self.instruction, 1, 0) layout.addWidget(self.edit, 2, 0) layout.addWidget(self.button, 2, 1) layout.addWidget(self.copy, 3, 0) layout.addWidget(self.arrange, 3, 1) # Set dialog layout self.setLayout(layout) # Add button to get directory path self.button.clicked.connect(self.openDirectoryDialog) # add button to execute Junkfile self.arrange.clicked.connect(self.runJunkfile)
def __init__(self, parent, name, data): if not type(data) == binaryninja.binaryview.BinaryView: raise Exception('expected widget data to be a BinaryView') self.bv = data QWidget.__init__(self, parent) DockContextHandler.__init__(self, self, name) self.actionHandler = UIActionHandler() self.actionHandler.setupActionHandler(self) layout = QVBoxLayout() self.consoleText = QTextEdit(self) self.consoleText.setReadOnly(True) self.consoleText.setFont(getMonospaceFont(self)) layout.addWidget(self.consoleText, 1) inputLayout = QHBoxLayout() inputLayout.setContentsMargins(4, 4, 4, 4) promptLayout = QVBoxLayout() promptLayout.setContentsMargins(0, 5, 0, 5) inputLayout.addLayout(promptLayout) self.consoleEntry = QLineEdit(self) inputLayout.addWidget(self.consoleEntry, 1) label = QLabel("dbg>>> ", self) label.setFont(getMonospaceFont(self)) promptLayout.addWidget(label) promptLayout.addStretch(1) self.consoleEntry.returnPressed.connect(lambda: self.sendLine()) layout.addLayout(inputLayout) layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) self.setLayout(layout)
def _load(self): if self.loaded: return self.service = locator.get_scoped("DialogueService") module_service = locator.get_scoped("ModuleService") characters_model = module_service.get_module( "Characters").entries_model layout = QHBoxLayout(self) characters_list = QListView() characters_list.setModel(characters_model) characters_list.setSizePolicy( QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)) characters_list.selectionModel().currentRowChanged.connect( self._update_selection) self.list = characters_list scroll_area = QScrollArea() form_container = QWidget() form = QFormLayout() self.editors = [] for dialogue in self.service.dialogues: label = QLabel(dialogue.name) editor = QLineEdit() editor.editingFinished.connect( lambda e=editor, d=dialogue: self._on_editor_change(e, d)) self.editors.append(editor) form.addRow(label, editor) form_container.setLayout(form) scroll_area.setWidgetResizable(True) scroll_area.setWidget(form_container) layout.addWidget(characters_list) layout.addWidget(scroll_area) self.setLayout(layout) self.service.load() self.loaded = True
def setup_ui(self): self.grid = QGridLayout() self.edit_search = QLineEdit(self) self.edit_search.setPlaceholderText("Type to filter") self.edit_search.textChanged.connect(self.on_filter_update) self.checkbox_personal = QCheckBox(self) self.checkbox_personal.setText("Include personal Mime types (prs-*)") self.checkbox_personal.setChecked(True) self.checkbox_personal.stateChanged.connect(self.on_filter_update) self.checkbox_vendor = QCheckBox(self) self.checkbox_vendor.setText("Include vendor Mime types (vnd-*)") self.checkbox_vendor.setChecked(True) self.checkbox_vendor.stateChanged.connect(self.on_filter_update) self.checkbox_ext = QCheckBox(self) self.checkbox_ext.setText("Include extensions Mime types (x-*)") self.checkbox_ext.setChecked(True) self.checkbox_ext.stateChanged.connect(self.on_filter_update) self.text_status = QLabel(self) self.list_widget = QListWidget(self) self.list_widget.setSelectionMode(QListWidget.NoSelection) self.list_widget.setAlternatingRowColors(True) self.list_widget.setStyleSheet(''' QListView::item { border: 1px solid #c5c5c5; } ''') self.grid.addWidget(self.edit_search, 0, 1, 1, 3) self.grid.addWidget(self.checkbox_personal, 1, 1, 1, 1) self.grid.addWidget(self.checkbox_vendor, 1, 2, 1, 1) self.grid.addWidget(self.checkbox_ext, 1, 3, 1, 1) self.grid.addWidget(self.text_status, 2, 1, 1, 3) self.grid.addWidget(self.list_widget, 3, 1, 1, 3)
def __init__(self): super().__init__() self.setLayout(QVBoxLayout()) self.lblStatus = QLabel("Idle", self) self.layout().addWidget(self.lblStatus) self.editUrl = QLineEdit(self._DEF_URL, self) self.layout().addWidget(self.editUrl) self.editResponse = QTextEdit("", self) self.layout().addWidget(self.editResponse) self.btnFetch = QPushButton("Fetch", self) self.btnFetch.clicked.connect(self.on_btnFetch_clicked) self.layout().addWidget(self.btnFetch) self.session = aiohttp.ClientSession( loop=asyncio.get_event_loop(), timeout=aiohttp.ClientTimeout(total=self._SESSION_TIMEOUT), )
def __init__(self, checkBoxLabel="Prefix", lineEditText="JNT", contentMargin=[0, 0, 0, 0]): super(CheckBoxWithLineEdit, self).__init__() self.checkBox = QCheckBox(checkBoxLabel) self.lineEdit = QLineEdit(lineEditText, self) # setting up fonts self.checkBox.setFont(small_font) self.lineEdit.setFont(small_font) self.lineEdit.setTextMargins(5, 5, 5, 5) self.lineEdit.setContentsMargins(contentMargin[0], contentMargin[1], \ contentMargin[2], contentMargin[3]) # margin = self.lineEdit.getContentsMargins() # margin = QLabel(str(margin), self) self.hbox = QHBoxLayout() self.hbox.addWidget(self.checkBox) self.hbox.addWidget(self.lineEdit) # self.hbox.addWidget(margin) self.setLayout(self.hbox) self.setFixedHeight(60)
def gui_init(self): layout = QHBoxLayout() layout.setAlignment(Qt.AlignCenter) self.setLayout(layout) label = QLabel() label.setText(self.__title) ipValidator = QRegExpValidator(self.RegEx, self) self.__text = QLineEdit() if self.RegEx: self.__text.setValidator(ipValidator) button = QPushButton() button.setText(self.__label) button_func = lambda: self.__button_func(self) button.pressed.connect(button_func) layout.addWidget(label) layout.addWidget(self.__text) layout.addWidget(button)
def _init_UI(self): self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Example 7') self.label_name = QLabel("form name", self) self.text = QTextEdit("kek", self) # self.kek_btn = QLabel("kek", self) self.kek_btn = QPushButton("kek", self) self.form_name = QLineEdit(self.windowTitle(), self) self.layout = QFormLayout(self) self.layout.addRow(self.label_name, self.form_name) self.layout.addRow(self.kek_btn, self.text) self.form_name.textChanged.connect(self.set_title) self.kek_btn.clicked.connect(self.set_text) # self.layout.addWidget(self.kek_btn, 0, 0) # self.layout.addWidget(self.text, 0, 1) self.setLayout(self.layout) self.show()
def __init__(self, parent=None): super().__init__(parent) self.setWindowFlags(Qt.Popup) self.setAttribute(Qt.WA_TranslucentBackground) layout = QVBoxLayout(self) self.edit = QLineEdit(self) layout.addWidget(self.edit) self.setLayout(layout) # 現在のマウス位置にGUIを出す size_x = 200 size_y = 50 pos = QCursor().pos() self.setGeometry(pos.x() - size_x, pos.y() - size_y, size_x, size_y) self.edit.returnPressed.connect(self.Submit) self.edit.setFocus()
def __init__(self, console, otp_key, parent=None): super(Form, self).__init__(parent) self.console = console self.otp_key = otp_key self.logger = Logger('Rule', Logger.INFO) self.setWindowTitle("PttOTP 驗證視窗") self.setWindowIcon(util.load_icon(config.icon_small)) self.setWindowFlags(Qt.WindowStaysOnTopHint) rule_text = ''' 1. 請開啟 google authenticator 掃描以下圖片 2. 於下方輸入框輸入 google authenticator 顯示的驗證碼 ''' rule_text = rule_text.strip() layout = QVBoxLayout() for rule_line in rule_text.split('\n'): layout.addWidget(QLabel(rule_line)) label = QLabel() label.setPixmap(QPixmap('./temp.png')) layout.addWidget(label) button_layout = QHBoxLayout() self.otp_edit = QLineEdit() button_layout.addWidget(self.otp_edit) ok_button = QPushButton("驗證") ok_button.clicked.connect(self.click_verify) button_layout.addWidget(ok_button) layout.addLayout(button_layout) self.setLayout(layout) self.ok = False
def _setup_ui(self): layout = QHBoxLayout(self) self.setLayout(layout) layout.setSpacing(3) layout.setMargin(1) self.ebank = SubComparator(self, 3, on_change=self._update_address) layout.addWidget(self.ebank) self.fext = SubComparator(self, 3, on_change=self._update_address) layout.addWidget(self.fext) self.fbank = SubComparator(self, 5, on_change=self._update_address) layout.addWidget(self.fbank) self.s = SubComparator(self, 12, on_change=self._update_address) layout.addWidget(self.s) # Create a grouping widget for the S label and decoded octal value box label_value_layout = QHBoxLayout() label_value_layout.setSpacing(3) label_value_layout.setMargin(1) label_value_layout.setContentsMargins(0, 33, 0, 0) layout.addLayout(label_value_layout) # Create a value box for displaying the overall decoded address self._addr_value = QLineEdit(self) label_value_layout.addWidget(self._addr_value) self._addr_value.setFixedSize(70, 32) self._addr_value.setReadOnly(True) self._addr_value.setAlignment(Qt.AlignCenter) self._addr_value.setText('0000') self._addr_value.setStyleSheet("QLineEdit { color: #555; }") # Create a label to show 'S' label = QLabel(f"S{self.num}", self) label.setFixedWidth(20) label_value_layout.addWidget(label)
def __init__(self): super().__init__() self.setWindowTitle("QSS Tester") self.editor = QPlainTextEdit() self.editor.textChanged.connect(self.update_styles) layout = QVBoxLayout() layout.addWidget(self.editor) # Define a set of simple widgets. cb = QCheckBox("Checkbox") layout.addWidget(cb) combo = QComboBox() combo.setObjectName("thecombo") combo.addItems(["First", "Second", "Third", "Fourth"]) layout.addWidget(combo) sb = QSpinBox() sb.setRange(0, 99999) layout.addWidget(sb) l = QLabel("This is a label") layout.addWidget(l) le = QLineEdit() le.setObjectName("mylineedit") layout.addWidget(le) pb = QPushButton("Push me!") layout.addWidget(pb) self.container = QWidget() self.container.setLayout(layout) self.setCentralWidget(self.container)
def __init__(self, parent=None): super(App, self).__init__(parent) self.layout = QVBoxLayout() self.top_layout = QHBoxLayout() self.open_button = QPushButton("Open") self.open_button.clicked.connect(self.getfile) self.top_layout.addWidget(self.open_button) self.file_path = QLineEdit() self.top_layout.addWidget(self.file_path) self.dry_run_checkbox = QCheckBox("Dryrun") self.dry_run_checkbox.setChecked(False) self.dry_run_checkbox.toggled.connect(lambda: self.set_dry_run()) self.is_dryrun = False self.top_layout.addWidget(self.dry_run_checkbox) self.layout.addLayout(self.top_layout) self.contents = QTextEdit() self.layout.addWidget(self.contents) self.help = "help" self.bottom_layout = QHBoxLayout() self.help_button = QPushButton("Help") self.help_button.clicked.connect(lambda: self.set_info(self.help)) self.bottom_layout.addWidget(self.help_button) self.bottom_layout.addStretch(1) self.run_button = QPushButton("Run") self.run_button.clicked.connect(self.fix_and_clean) self.bottom_layout.addWidget(self.run_button) self.layout.addLayout(self.bottom_layout) self.setLayout(self.layout) self.setWindowTitle("OpenMW NIF Converter") self.processor = Processor(self.contents.append)
def __init__(self): super().__init__() self.resize(300,300) #输入个人信息 label_name=QLabel("请输入姓名") self.edit_name=QLineEdit() #文本标签 label_pos=QLabel("请选择测试项目") label_pos.resize(20,20) #下拉选择框 self.cbox_pos=QComboBox(self) self.cbox_pos.move(100,50) self.cbox_pos.addItem('仰卧起坐') self.cbox_pos.addItem('俯卧撑') self.cbox_pos.addItem('引体向上') #开始测试按钮 self.start_button = QPushButton("开始测试") # button1.clicked.connect(self.start) #倒计时功能 init = 60 self.lcd_cntDown=QLCDNumber() self.lcd_cntDown.display(init) #布局 layout =QVBoxLayout(self) layout.addWidget(label_name) layout.addWidget(self.edit_name) layout.addWidget(label_pos) layout.addWidget(self.cbox_pos) layout.addWidget(self.start_button) layout.addWidget(self.lcd_cntDown) self.setLayout(layout)
def __init__(self, params): super(ChooseFileInputWidget_PortInstanceWidget, self).__init__() self.file_path = '' # UI self.setLayout(QVBoxLayout()) self.path_line_edit = QLineEdit() self.path_line_edit.setPlaceholderText('file path...') self.path_line_edit.textChanged.connect(M(self.set_file_path)) self.select_file_button = QPushButton('select') self.select_file_button.clicked.connect( M(self.select_file_button_clicked)) self.layout().addWidget(self.path_line_edit) self.layout().addWidget(self.select_file_button) self.setStyleSheet(''' QWidget { background: transparent; } QLineEdit { border-radius: 10px; background-color: transparent; border: 1px solid #202020; color: #aaaaaa; padding: 3px; } QPushButton { background-color: #36383B; padding-top: 5px; padding-bottom: 5px; padding-left: 22px; padding-right: 22px; border: 1px solid #666666; border-radius: 5px; } ''') self.setFixedWidth(150)
def __init__(self): super().__init__() # Título da janela. self.setWindowTitle('PySide2 QWidget e connect().') # Ícone da janela principal icon = QIcon() icon.addPixmap(QPixmap('../../images/icons/icon.png')) self.setWindowIcon(icon) # Tamanho inicial da janela. screen_size = app.desktop().geometry() # screen_size = app.primaryScreen().geometry() width = screen_size.width() height = screen_size.height() self.resize(width / 2, height / 2) # Tamanho mínimo da janela. self.setMinimumSize(width / 2, height / 2) # Tamanho maximo da janela. self.setMaximumSize(width - 200, height - 200) vbox = QVBoxLayout() self.setLayout(vbox) self.label = QLabel( 'Este texto será alterado quando o botão for clicado!') self.label.setAlignment(Qt.AlignCenter) vbox.addWidget(self.label) self.line_edit = QLineEdit() self.line_edit.setPlaceholderText('Digite algo') vbox.addWidget(self.line_edit) push_button = QPushButton('Clique Aqui') push_button.clicked.connect(self.on_button_clicked) vbox.addWidget(push_button)
def __init__(self, parent=None, post_stats: bool = True): # ================================ # instantiation super and setup ui # ================================ super().__init__(parent, post_stats, ui=AppBaseClassUISimplified01) # ================ # instantiation ui # ================ c = Counter() self.ui.p2_layout = QGridLayout(self.ui.page_2) self.ui.p2_layout.setVerticalSpacing( 5), self.ui.p2_layout.setHorizontalSpacing(5) self.ui.p2_layout.addWidget(QLabel('<b>Inputs</b>'), c.count, 0, 1, 3) self.ui.p2_layout.addWidget(QLabel('Database'), c.value, 0, 1, 1) self.ui.p2_in_distribution = QLineEdit() self.ui.p2_in_distribution.setMinimumWidth(150) self.ui.p2_layout.addWidget(self.ui.p2_in_distribution, c.value, 1, 1, 1) self.ui.p2_in_fp_inputs = QPushButton('Select') self.ui.p2_in_fp_inputs.setStyleSheet( 'padding-left:10px; padding-right:10px; padding-top:2px; padding-bottom:2px;' ) self.ui.p2_layout.addWidget(self.ui.p2_in_fp_inputs, c.count, 2, 1, 1) self.ui.p3_example.setText('Bluebeam toolbox') # ================= # signals and slots # ================= def select_database(): self.ui.p2_in_distribution.setText( realpath( QtWidgets.QFileDialog.getOpenFileName( self, 'Select database', '', 'Spreadsheet (*.csv *.xlsx)')[0])) self.ui.p2_in_fp_inputs.clicked.connect(select_database)
def steamapi_key_dialog(self): self.steamapi_window = QDialog() self.steamapi_window.setWindowTitle(_("Set steamapi key")) self.steamapi_window.setWindowIcon(self.switcher_logo) layout = QVBoxLayout() self.steamapi_window.setLayout(layout) text_label = QLabel( _("Used for getting avatars. Get yours from <a href='https://steamcommunity.com/dev/apikey'>steam</a>" )) apikey_edit = QLineEdit() save_button = QPushButton(_("Save")) text_label.setOpenExternalLinks(True) apikey_edit.setText(self.switcher.settings.get("steam_api_key")) layout.addWidget(text_label) layout.addWidget(apikey_edit) layout.addWidget(save_button) def save_enabled(): save_button.setEnabled( self.is_valid_steampi_key(apikey_edit.text())) def save(): self.switcher.settings["steam_api_key"] = apikey_edit.text() self.switcher.settings_write() self.steamapi_window.hide() if self.switcher.first_run: self.import_accounts_dialog() save_enabled() apikey_edit.textChanged.connect(lambda: save_enabled()) save_button.clicked.connect(lambda: save()) self.steamapi_window.show()
def createtoplayout(self): self.topGroupBox = QGroupBox("") self.open_location_button = QtWidgets.QPushButton("Full Path Location") self.open_location_button.setAutoDefault(False) self.textboxlabel = QLabel("Wildcard") self.textboxlabel.setMinimumWidth(100) self.lineEdit = QLineEdit("") text_box_layout = QHBoxLayout() text_box_layout.addWidget(self.textboxlabel) text_box_layout.addWidget(self.lineEdit ) self.infoboxlabel = QLabel("Number of Videos to Process") self.infoboxlabel.setMinimumWidth(100) self.numberbox = QLabel("0") self.numberbox.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken ) self.numberbox.setStyleSheet(""" QWidget { padding: 1px; border-style: solid; border: 1px solid #1e1e1e; border-radius: 5; min-height: 15px; font-size: 12px; } """) info_box_layout = QHBoxLayout() info_box_layout.addWidget(self.infoboxlabel) info_box_layout.addWidget(self.numberbox) layout = QVBoxLayout() layout.addWidget(self.open_location_button) layout.addLayout(text_box_layout) layout.addLayout(info_box_layout) layout.addStretch(1) self.topGroupBox.setLayout(layout)
def __init__(self, parent=None): super().__init__(parent) layout = QFormLayout(self) self._database = parent._database self.setWindowTitle("Enter New Definition to Dictionary") self._select_dictionary = QComboBox() self._select_dictionary.addItems(self._database.getDatabaseNames()) self._definition_name = QLineEdit() self._definition_name.setObjectName("defname") self._definition_name.setStyleSheet( 'QWidget[objectName^="defname"]{background-color: #FFFFFF; color: #000000;}' ) self._definition = DefinitionTextBox(self) self._definition.setObjectName("thedef") self._definition.setStyleSheet( 'QWidget[objectName^="thedef"]{background-color: #FFFFFF; color: #000000;}' ) button_row = QWidget(self) button_layout = QHBoxLayout(button_row) self._enter_button = QPushButton("Enter") self._enter_button.clicked.connect(self.enter) self._cancel_button = QPushButton("Cancel") self._canceled = True self._cancel_button.clicked.connect(self.close) button_layout.addWidget(self._enter_button) button_layout.addWidget(self._cancel_button) layout.addRow( QLabel( "Select the dictionary you would like to add the definition:")) layout.addRow(self._select_dictionary) layout.addRow(BreakLine(self)) layout.addRow("Enter the defintion name:", self._definition_name) layout.addRow("Enter the definition:", self._definition) layout.addRow(button_row)
def __init__(self): super().__init__() container = QWidget() layout = QVBoxLayout() self.search = QLineEdit() self.search.textChanged.connect(self.update_filter) self.table = QTableView() layout.addWidget(self.search) layout.addWidget(self.table) container.setLayout(layout) self.model = QSqlTableModel(db=db) self.table.setModel(self.model) self.model.setTable("Track") self.model.select() self.setMinimumSize(QSize(1024, 600)) self.setCentralWidget(container)
def __init__(self, content_widget): super(InputWidget, self).__init__() self.content_widget = content_widget self.main_grid_layout = QGridLayout() self.name_line_edit = QLineEdit() self.name_line_edit.setPlaceholderText('widget name') self.name_line_edit.editingFinished.connect(self.name_line_edit_edited) self.main_grid_layout.addWidget(self.name_line_edit, 0, 0, 1, 2) self.del_button = QPushButton() self.del_button.setText('delete') self.del_button.clicked.connect(self.delete_clicked) self.main_grid_layout.addWidget(self.del_button, 1, 1) self.setLayout(self.main_grid_layout) f = open('template files/input_widget_default_template.txt', 'r') self.code = f.read() f.close()
def __init__(self): super().__init__() self.locale = QLocale() self.setContentsMargins(0, 0, 0, 0) hbox = QHBoxLayout(self) hbox.setContentsMargins( 0, 0, 0, 0, ) self.slider = QSlider(Qt.Horizontal, self) self.slider.setMinimum(self.slider_min) self.slider.setMaximum(self.slider_max) self.slider.setSingleStep(self.slider_step) self.line_edit = QLineEdit('', self) self.line_edit.setAlignment(Qt.AlignCenter) self.line_edit.setMaximumWidth(self.line_edit_width) self.line_edit.setMaximumHeight(self.line_edit_heigth) self.line_edit.setMinimumHeight(self.line_edit_heigth) hbox.addWidget(self.slider) hbox.addWidget(self.line_edit) self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Minimum)
def __init__(self, parent=None, tab_names=[]): super().__init__(parent) layout = QFormLayout(self) self._current_tab_names = tab_names self.setWindowTitle("Enter New Page Tab Name") self._tab_name = QLineEdit() self._tab_name.setPlaceholderText("Enter name... ") self.createNewTabName() button_row = QWidget(self) button_layout = QHBoxLayout(button_row) self._enter_button = QPushButton("Enter") self._enter_button.clicked.connect(self.enter) self._cancel_button = QPushButton("Cancel") self._canceled = True self._cancel_button.clicked.connect(self.close) button_layout.addWidget(self._enter_button) button_layout.addWidget(self._cancel_button) layout.addRow("Tab Name:", self._tab_name) layout.addRow(button_row)