Python PyQt5.QtWidgets.QHBoxLayout() Examples
The following are 30
code examples of PyQt5.QtWidgets.QHBoxLayout().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PyQt5.QtWidgets
, or try the search function
.
Example #1
Source File: input_button_clear.py From Python_Master_Courses with GNU General Public License v3.0 | 7 votes |
def initUI(self): self.inputLabel = QLabel("Input your text") self.editLine = QLineEdit() self.printButton = QPushButton("Print") self.clearButton = QPushButton("Clear") self.printButton.clicked.connect(self.printText) self.clearButton.clicked.connect(self.clearText) inputLayout = QHBoxLayout() inputLayout.addWidget(self.inputLabel) inputLayout.addWidget(self.editLine) buttonLayout = QHBoxLayout() buttonLayout.addWidget(self.printButton) buttonLayout.addWidget(self.clearButton) mainLayout = QVBoxLayout() mainLayout.addLayout(inputLayout) mainLayout.addLayout(buttonLayout) self.setLayout(mainLayout) self.setWindowTitle('FristWindow') self.show()
Example #2
Source File: addition.py From MusicBox with MIT License | 7 votes |
def __init__(self, parent=None): super(SearchLineEdit, self).__init__() self.setObjectName("SearchLine") self.parent = parent self.setMinimumSize(218, 20) with open('QSS/searchLine.qss', 'r') as f: self.setStyleSheet(f.read()) self.button = QPushButton(self) self.button.setMaximumSize(13, 13) self.button.setCursor(QCursor(Qt.PointingHandCursor)) self.setTextMargins(3, 0, 19, 0) self.spaceItem = QSpacerItem(150, 10, QSizePolicy.Expanding) self.mainLayout = QHBoxLayout() self.mainLayout.addSpacerItem(self.spaceItem) # self.mainLayout.addStretch(1) self.mainLayout.addWidget(self.button) self.mainLayout.addSpacing(10) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.setLayout(self.mainLayout)
Example #3
Source File: command_line.py From CHATIMUSMAXIMUS with GNU General Public License v3.0 | 7 votes |
def __init__(self, parent=None): super().__init__(parent) prompt = 'user@chatimus ~$' self.button = QtWidgets.QPushButton(prompt) self.button.setStyleSheet("""color: white; font: bold; font-size: 18px;""") # TODO: intergrate into stylesheet # NOTE: setting `outline: None` did not work self.button.setFlat(True) self.line_edit = LineEdit() layout = QtWidgets.QHBoxLayout() layout.addWidget(self.button) layout.addWidget(self.line_edit) layout.setSpacing(0) self.setLayout(layout) self.listener_signal = self.line_edit.listener_signal self.button.clicked.connect(self.give_focus)
Example #4
Source File: Game11.py From Games with MIT License | 6 votes |
def initUI(self): # 块大小 self.grid_size = 22 # 游戏帧率 self.fps = 200 self.timer = QBasicTimer() # 焦点 self.setFocusPolicy(Qt.StrongFocus) # 水平布局 layout_horizontal = QHBoxLayout() self.inner_board = InnerBoard() self.external_board = ExternalBoard(self, self.grid_size, self.inner_board) layout_horizontal.addWidget(self.external_board) self.side_panel = SidePanel(self, self.grid_size, self.inner_board) layout_horizontal.addWidget(self.side_panel) self.status_bar = self.statusBar() self.external_board.score_signal[str].connect(self.status_bar.showMessage) self.start() self.center() self.setWindowTitle('Tetris-公众号:Charles的皮卡丘') self.show() self.setFixedSize(self.external_board.width() + self.side_panel.width(), self.side_panel.height() + self.status_bar.height())
Example #5
Source File: ddt4all.py From ddt4all with GNU General Public License v3.0 | 6 votes |
def __init__(self, ecuscanner): super(Ecu_finder, self).__init__() self.ecuscanner = ecuscanner layoutv = widgets.QVBoxLayout() layouth = widgets.QHBoxLayout() self.setLayout(layoutv) layoutv.addLayout(layouth) self.ecuaddr = widgets.QLineEdit() self.ecuident = widgets.QLineEdit() layouth.addWidget(widgets.QLabel("Addr :")) layouth.addWidget(self.ecuaddr) layouth.addWidget(widgets.QLabel("ID frame :")) layouth.addWidget(self.ecuident) button = widgets.QPushButton("VALIDATE") layouth.addWidget(button) button.clicked.connect(self.check)
Example #6
Source File: qiew.py From qiew with GNU General Public License v2.0 | 6 votes |
def initUI(self): self.wid = binWidget(self, self._source) self.hbox = QtWidgets.QHBoxLayout() self.hbox.addWidget(self.wid) self.setLayout(self.hbox) screen = QtWidgets.QDesktopWidget().screenGeometry() self.setGeometry(0, 0, screen.width()-100, screen.height()-100) self.setWindowTitle(self._title) #self.showMaximized() self.wid.activateWindow() self.raise_() self.installEventFilter(self)
Example #7
Source File: lab4.py From Computer-graphics with MIT License | 6 votes |
def __init__(self): QtWidgets.QWidget.__init__(self) uic.loadUi("window.ui", self) self.scene = QtWidgets.QGraphicsScene(0, 0, 511, 511) self.mainview.setScene(self.scene) self.image = QImage(511, 511, QImage.Format_ARGB32_Premultiplied) self.pen = QPen() self.color_line = QColor(Qt.black) self.color_bground = QColor(Qt.white) self.draw_once.clicked.connect(lambda: draw_once(self)) self.clean_all.clicked.connect(lambda: clear_all(self)) self.btn_bground.clicked.connect(lambda: get_color_bground(self)) self.btn_line.clicked.connect(lambda: get_color_line(self)) self.draw_centr.clicked.connect(lambda: draw_centr(self)) layout = QtWidgets.QHBoxLayout() layout.addWidget(self.what) layout.addWidget(self.other) self.setLayout(layout) self.circle.setChecked(True) self.canon.setChecked(True) #self.circle.toggled.connect(lambda : change_text(self))
Example #8
Source File: first.py From FIRST-plugin-ida with GNU General Public License v2.0 | 6 votes |
def populate_main_form(self): list_view = QtWidgets.QListView() list_view.setFixedWidth(115) list_view.setModel(self.views_model) select = QtCore.QItemSelectionModel.Select list_view.selectionModel().select(self.views_model.createIndex(0, 0), select) list_view.clicked.connect(self.view_clicked) current_view = QtWidgets.QWidget() view = self.view_about() if not view: view = QtWidgets.QBoxLayout() current_view.setLayout(view) self.splitter = QtWidgets.QSplitter(Qt.Horizontal) self.splitter.addWidget(list_view) self.splitter.addWidget(current_view) self.splitter.setChildrenCollapsible(False) self.splitter.show() outer_layout = QtWidgets.QHBoxLayout() outer_layout.addWidget(self.splitter) self.parent.setLayout(outer_layout)
Example #9
Source File: first.py From FIRST-plugin-ida with GNU General Public License v2.0 | 6 votes |
def view_configuration_info(self): self.thread_stop = True container = QtWidgets.QVBoxLayout() label = QtWidgets.QLabel('Configuration Information') label.setStyleSheet('font: 18px;') container.addWidget(label) layout = QtWidgets.QHBoxLayout() self.message = QtWidgets.QLabel() layout.addWidget(self.message) layout.addStretch() save_button = QtWidgets.QPushButton('Save') layout.addWidget(save_button) scroll_layout = FIRSTUI.ScrollWidget(frame=QtWidgets.QFrame.NoFrame) FIRSTUI.SharedObjects.server_config_layout(self, scroll_layout, FIRST.config) container.addWidget(scroll_layout) container.addStretch() container.addLayout(layout) save_button.clicked.connect(self.save_config) return container
Example #10
Source File: window.py From visma with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent=None): super().__init__(parent) self.textQVBoxLayout = QtWidgets.QVBoxLayout() self.textUpQLabel = QtWidgets.QLabel() self.textDownQLabel = QtWidgets.QLabel() self.textQVBoxLayout.addWidget(self.textUpQLabel) self.textQVBoxLayout.addWidget(self.textDownQLabel) self.allQHBoxLayout = QtWidgets.QHBoxLayout() self.allQHBoxLayout.addLayout(self.textQVBoxLayout, 1) self.setLayout(self.allQHBoxLayout) self.textUpQLabel.setStyleSheet(''' color: black; ''') self.textDownQLabel.setStyleSheet(''' color: black; ''')
Example #11
Source File: viewer.py From IDAngr with BSD 2-Clause "Simplified" License | 5 votes |
def setupUi(self, IDAngrTextViewer): IDAngrTextViewer.setObjectName("IDAngrTextViewer") IDAngrTextViewer.resize(812, 612) self.gridLayout = QtWidgets.QGridLayout(IDAngrTextViewer) self.gridLayout.setObjectName("gridLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.plainBox = QtWidgets.QRadioButton(IDAngrTextViewer) self.plainBox.setChecked(True) self.plainBox.setObjectName("plainBox") self.horizontalLayout.addWidget(self.plainBox) self.hexBox = QtWidgets.QRadioButton(IDAngrTextViewer) self.hexBox.setObjectName("hexBox") self.horizontalLayout.addWidget(self.hexBox) self.pyBox = QtWidgets.QRadioButton(IDAngrTextViewer) self.pyBox.setObjectName("pyBox") self.horizontalLayout.addWidget(self.pyBox) self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) self.plainTextEdit = QtWidgets.QPlainTextEdit(IDAngrTextViewer) self.plainTextEdit.setReadOnly(True) self.plainTextEdit.setPlainText("") self.plainTextEdit.setObjectName("plainTextEdit") self.gridLayout.addWidget(self.plainTextEdit, 1, 0, 1, 1) self.retranslateUi(IDAngrTextViewer) QtCore.QMetaObject.connectSlotsByName(IDAngrTextViewer)
Example #12
Source File: Ui_WHoleMag.py From pyleecan with Apache License 2.0 | 5 votes |
def setupUi(self, WHoleMag): WHoleMag.setObjectName("WHoleMag") WHoleMag.resize(760, 490) WHoleMag.setMinimumSize(QtCore.QSize(760, 490)) self.main_layout = QtWidgets.QVBoxLayout(WHoleMag) self.main_layout.setContentsMargins(5, 5, 5, 5) self.main_layout.setSpacing(4) self.main_layout.setObjectName("main_layout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.c_hole_type = QtWidgets.QComboBox(WHoleMag) self.c_hole_type.setObjectName("c_hole_type") self.c_hole_type.addItem("") self.c_hole_type.addItem("") self.c_hole_type.addItem("") self.c_hole_type.addItem("") self.c_hole_type.addItem("") self.c_hole_type.addItem("") self.c_hole_type.addItem("") self.horizontalLayout.addWidget(self.c_hole_type) spacerItem = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum ) self.horizontalLayout.addItem(spacerItem) self.main_layout.addLayout(self.horizontalLayout) self.w_hole = QtWidgets.QWidget(WHoleMag) sizePolicy = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.w_hole.sizePolicy().hasHeightForWidth()) self.w_hole.setSizePolicy(sizePolicy) self.w_hole.setMinimumSize(QtCore.QSize(750, 450)) self.w_hole.setObjectName("w_hole") self.main_layout.addWidget(self.w_hole) self.retranslateUi(WHoleMag) QtCore.QMetaObject.connectSlotsByName(WHoleMag)
Example #13
Source File: file_transfer.py From uPyLoader with MIT License | 5 votes |
def setupUi(self, FileTransferDialog): FileTransferDialog.setObjectName("FileTransferDialog") FileTransferDialog.resize(400, 120) self.verticalLayout_2 = QtWidgets.QVBoxLayout(FileTransferDialog) self.verticalLayout_2.setObjectName("verticalLayout_2") self.label = QtWidgets.QLabel(FileTransferDialog) self.label.setObjectName("label") self.verticalLayout_2.addWidget(self.label) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.progressBar = QtWidgets.QProgressBar(FileTransferDialog) self.progressBar.setProperty("value", 24) self.progressBar.setObjectName("progressBar") self.verticalLayout.addWidget(self.progressBar) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.cancelButton = QtWidgets.QPushButton(FileTransferDialog) self.cancelButton.setEnabled(False) self.cancelButton.setCheckable(False) self.cancelButton.setObjectName("cancelButton") self.horizontalLayout.addWidget(self.cancelButton) self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout_2.addLayout(self.verticalLayout) self.retranslateUi(FileTransferDialog) QtCore.QMetaObject.connectSlotsByName(FileTransferDialog)
Example #14
Source File: error_window.py From persepolis with GNU General Public License v3.0 | 5 votes |
def __init__(self, text): super().__init__() # finding windows_size self.setMinimumSize(QSize(363, 300)) self.setWindowIcon(QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg'))) self.setWindowTitle('Persepolis Download Manager') verticalLayout = QVBoxLayout(self) horizontalLayout = QHBoxLayout() horizontalLayout.addStretch(1) self.text_edit = QTextEdit(self) self.text_edit.setReadOnly(True) self.text_edit.insertPlainText(text) verticalLayout.addWidget(self.text_edit) self.label2 = QLabel(self) self.label2.setText('Reseting persepolis may solving problem.\nDo not panic!If you add your download links again,\npersepolis will resume your downloads\nPlease copy this error message and press "Report Issue" button\nand open a new issue in Github for it.\nWe answer you as soon as possible. \nreporting this issue help us to improve persepolis.\nThank you!') verticalLayout.addWidget(self.label2) self.report_pushButton = QPushButton(self) self.report_pushButton.setText("Report Issue") horizontalLayout.addWidget(self.report_pushButton) self.reset_persepolis_pushButton = QPushButton(self) self.reset_persepolis_pushButton.clicked.connect( self.resetPushButtonPressed) self.reset_persepolis_pushButton.setText('Reset Persepolis') horizontalLayout.addWidget(self.reset_persepolis_pushButton) self.close_pushButton = QPushButton(self) self.close_pushButton.setText('close') horizontalLayout.addWidget(self.close_pushButton) verticalLayout.addLayout(horizontalLayout) self.report_pushButton.clicked.connect(self.reportPushButtonPressed) self.close_pushButton.clicked.connect(self.closePushButtonPressed)
Example #15
Source File: adventure.py From networkzero with MIT License | 5 votes |
def __init__(self, parent=None): super(Adventure, self).__init__(parent) # # Top-half of the # self.image_panel = QtWidgets.QLabel() self.image_panel.setAlignment(QtCore.Qt.AlignCenter) self.image = QtGui.QPixmap("image.jpg") self.image_panel.setPixmap(self.image) self.text_panel = QtWidgets.QTextEdit() self.text_panel.setReadOnly(True) self.text_panel.setTextBackgroundColor(QtGui.QColor("blue")) self.text_panel.setHtml("""<h1>Hello, World!</h1> <p>You are in a spacious ballroom with the sound of music playing all around you.</p> """) self.data_panel = QtWidgets.QTextEdit() self.data_panel.setReadOnly(True) self.input = QtWidgets.QLineEdit() layout = QtWidgets.QVBoxLayout() layout.addWidget(self.image_panel, 1) hlayout = QtWidgets.QHBoxLayout() hlayout.addWidget(self.text_panel, 3) hlayout.addWidget(self.data_panel, 1) layout.addLayout(hlayout, 1) layout.addWidget(self.input) self.setLayout(layout) self.setWindowTitle("Westpark Adventure")
Example #16
Source File: menu_bar.py From CHATIMUSMAXIMUS with GNU General Public License v3.0 | 5 votes |
def __init__(self, model, parent=None): super().__init__(parent) self.setWindowTitle('CHATIMUS Settings') self.setStyleSheet('background: black; color: white;') ok_button = QtWidgets.QPushButton('Ok') ok_button.setDefault(True) cancel_button = QtWidgets.QPushButton('Cancel') apply_button = QtWidgets.QPushButton('Apply') layout = QtWidgets.QVBoxLayout() tree_view = QtWidgets.QTreeView() # tree_view.setHeaderHidden(True) tree_view.setModel(model) tree_view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems) tree_view.setUniformRowHeights(True) tree_view.setAnimated(False) tree_view.setAllColumnsShowFocus(True) tree_view.resizeColumnToContents(0) layout.addWidget(tree_view) horizontal_button_widget = QtWidgets.QWidget() horizontal_layout = QtWidgets.QHBoxLayout() horizontal_layout.addWidget(ok_button) horizontal_layout.addWidget(cancel_button) horizontal_layout.addWidget(apply_button) horizontal_button_widget.setLayout(horizontal_layout) layout.addWidget(horizontal_button_widget) ok_button.clicked.connect(self.done) cancel_button.clicked.connect(self.reject) # TODO: add in apply button connection self.setLayout(layout)
Example #17
Source File: Ui_SPreview.py From pyleecan with Apache License 2.0 | 5 votes |
def setupUi(self, SPreview): SPreview.setObjectName("SPreview") SPreview.resize(532, 450) SPreview.setMinimumSize(QtCore.QSize(0, 0)) self.verticalLayout = QtWidgets.QVBoxLayout(SPreview) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.w_plot = MPLCanvas2(SPreview) sizePolicy = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.w_plot.sizePolicy().hasHeightForWidth()) self.w_plot.setSizePolicy(sizePolicy) self.w_plot.setMinimumSize(QtCore.QSize(300, 300)) self.w_plot.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.w_plot.setObjectName("w_plot") self.horizontalLayout_2.addWidget(self.w_plot) self.tab_machine = WMachineTable(SPreview) self.tab_machine.setObjectName("tab_machine") self.horizontalLayout_2.addWidget(self.tab_machine) self.verticalLayout.addLayout(self.horizontalLayout_2) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum ) self.horizontalLayout.addItem(spacerItem) self.b_previous = QtWidgets.QPushButton(SPreview) self.b_previous.setObjectName("b_previous") self.horizontalLayout.addWidget(self.b_previous) self.b_next = QtWidgets.QPushButton(SPreview) self.b_next.setObjectName("b_next") self.horizontalLayout.addWidget(self.b_next) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(SPreview) QtCore.QMetaObject.connectSlotsByName(SPreview)
Example #18
Source File: SidebarWindow.py From pyleecan with Apache License 2.0 | 5 votes |
def __init__(self): # === App-Init === super(SidebarWindow, self).__init__() self._title = "Pyleecan" self.setWindowTitle(self._title) self._main = QtWidgets.QWidget() self.setCentralWidget(self._main) # === Main Widgets === # Navigation Panel with Button Group self.nav_panel = QtWidgets.QFrame() self.nav_btn_grp = QtWidgets.QButtonGroup() self.nav_btn_grp.setExclusive(True) self.nav_btn_grp.buttonClicked[int].connect(self.switch_stack) self.btn_grp_fct = [] self.nav_layout = QtWidgets.QVBoxLayout(self.nav_panel) self.nav_layout.setContentsMargins(2, 2, 2, 2) self.nav_layout.addStretch(1) # add stretch first # Sub Window Stack self.io_stack = QtWidgets.QStackedWidget(self) # Seperator Line line = QtWidgets.QFrame() line.setStyleSheet("QFrame { background-color: rgb(200, 200, 200) }") line.setFixedWidth(2) # === Main Layout === main_layout = QtWidgets.QHBoxLayout() main_layout.addWidget(self.nav_panel) main_layout.addWidget(line) main_layout.addWidget(self.io_stack) self._main.setLayout(main_layout) self.show() self.centerOnScreen()
Example #19
Source File: Ui_WVent.py From pyleecan with Apache License 2.0 | 5 votes |
def setupUi(self, WVent): WVent.setObjectName("WVent") WVent.resize(630, 470) WVent.setMinimumSize(QtCore.QSize(630, 470)) self.main_layout = QtWidgets.QVBoxLayout(WVent) self.main_layout.setObjectName("main_layout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.in_vent_type = QtWidgets.QLabel(WVent) self.in_vent_type.setObjectName("in_vent_type") self.horizontalLayout.addWidget(self.in_vent_type) self.c_vent_type = QtWidgets.QComboBox(WVent) self.c_vent_type.setObjectName("c_vent_type") self.c_vent_type.addItem("") self.c_vent_type.addItem("") self.c_vent_type.addItem("") self.horizontalLayout.addWidget(self.c_vent_type) spacerItem = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum ) self.horizontalLayout.addItem(spacerItem) self.main_layout.addLayout(self.horizontalLayout) self.w_vent = QtWidgets.QWidget(WVent) self.w_vent.setMinimumSize(QtCore.QSize(640, 480)) self.w_vent.setObjectName("w_vent") self.main_layout.addWidget(self.w_vent) self.retranslateUi(WVent) QtCore.QMetaObject.connectSlotsByName(WVent)
Example #20
Source File: Ui_PCondType22.py From pyleecan with Apache License 2.0 | 5 votes |
def setupUi(self, PCondType22): PCondType22.setObjectName("PCondType22") PCondType22.resize(460, 124) self.horizontalLayout = QtWidgets.QHBoxLayout(PCondType22) self.horizontalLayout.setObjectName("horizontalLayout") self.w_mat = WMatSelect(PCondType22) self.w_mat.setObjectName("w_mat") self.horizontalLayout.addWidget(self.w_mat) self.w_out = WBarOut(PCondType22) self.w_out.setObjectName("w_out") self.horizontalLayout.addWidget(self.w_out) self.retranslateUi(PCondType22) QtCore.QMetaObject.connectSlotsByName(PCondType22)
Example #21
Source File: DyStockMongoDbConfigDlg.py From DevilYuan with MIT License | 5 votes |
def _createTicksTab(self, tabWidget): widget = QWidget() labelStockTicksDb = QLabel('股票分笔数据库') self._lineEditStockTicksDb = QLineEdit(self._data["Ticks"]['db']) # 布局 hbox = QHBoxLayout() hbox.addWidget(labelStockTicksDb) hbox.addWidget(self._lineEditStockTicksDb) widget.setLayout(hbox) tabWidget.addTab(widget, "分笔数据")
Example #22
Source File: window.py From visma with GNU General Public License v3.0 | 5 votes |
def inputsLayout(self, loadList="Greek"): inputLayout = QHBoxLayout(self) inputWidget = QWidget() self.selectedCombo = str(loadList) for i in range(4): for j in range(10): if str(loadList) in "Greek": if (i * 10 + j) < len(self.inputGreek): self.buttons[(i, j)] = QtWidgets.QPushButton( self.inputGreek[i * 10 + j]) self.buttons[(i, j)].resize(100, 100) self.buttons[(i, j)].clicked.connect( self.onInputPress(self.inputGreek[i * 10 + j])) self.inputBox.addWidget(self.buttons[(i, j)], i, j) elif str(loadList) in "LaTeX": if (i * 10 + j) < len(self.inputLaTeX): self.buttons[(i, j)] = QtWidgets.QPushButton( self.inputLaTeX[i * 10 + j]) self.buttons[(i, j)].resize(100, 100) self.buttons[(i, j)].clicked.connect( self.onInputPress(self.inputLaTeX[i * 10 + j])) # (self.inputLaTeX[i * 3 + j]) self.inputBox.addWidget(self.buttons[(i, j)], i, j) inputWidget.setLayout(self.inputBox) # inputSplitter.addWidget(inputTypeSplitter) # inputSplitter.addWidget(inputWidget) inputLayout.addWidget(inputWidget) return inputLayout
Example #23
Source File: dockwidgets.py From Lector with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent): self.parent = parent self.parentTab = self.parent.parent self.searchThread = BackGroundTextSearch() self.searchOptionsLayout = QtWidgets.QHBoxLayout() self.searchTabLayout = QtWidgets.QVBoxLayout() self.searchTimer = QtCore.QTimer(self.parent) self.searchLineEdit = QtWidgets.QLineEdit(self.parent) self.searchBookButton = QtWidgets.QToolButton(self.parent) self.caseSensitiveSearchButton = QtWidgets.QToolButton(self.parent) self.matchWholeWordButton = QtWidgets.QToolButton(self.parent) self.searchResultsTreeView = QtWidgets.QTreeView(self.parent) self._translate = QtCore.QCoreApplication.translate self.search_string = self._translate('SideDock', 'Search') self.search_book_string = self._translate('SideDock', 'Search entire book') self.case_sensitive_string = self._translate('SideDock', 'Match case') self.match_word_string = self._translate('SideDock', 'Match word') self.create_widgets()
Example #24
Source File: TransformGuiTemplate_pyqt5.py From tf-pose with Apache License 2.0 | 5 votes |
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(224, 117) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth()) Form.setSizePolicy(sizePolicy) self.verticalLayout = QtWidgets.QVBoxLayout(Form) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setSpacing(1) self.verticalLayout.setObjectName("verticalLayout") self.translateLabel = QtWidgets.QLabel(Form) self.translateLabel.setObjectName("translateLabel") self.verticalLayout.addWidget(self.translateLabel) self.rotateLabel = QtWidgets.QLabel(Form) self.rotateLabel.setObjectName("rotateLabel") self.verticalLayout.addWidget(self.rotateLabel) self.scaleLabel = QtWidgets.QLabel(Form) self.scaleLabel.setObjectName("scaleLabel") self.verticalLayout.addWidget(self.scaleLabel) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.mirrorImageBtn = QtWidgets.QPushButton(Form) self.mirrorImageBtn.setToolTip("") self.mirrorImageBtn.setObjectName("mirrorImageBtn") self.horizontalLayout.addWidget(self.mirrorImageBtn) self.reflectImageBtn = QtWidgets.QPushButton(Form) self.reflectImageBtn.setObjectName("reflectImageBtn") self.horizontalLayout.addWidget(self.reflectImageBtn) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
Example #25
Source File: pkwidgets.py From pkmeter with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, etree, control, parent=None): QtWidgets.QPushButton.__init__(self) self.setLayout(QtWidgets.QHBoxLayout()) self.layout().setContentsMargins(0,0,0,0) self.layout().setSpacing(0) pkmixins.LayoutMixin._init(self, etree, control, parent)
Example #26
Source File: SpinnerWidget.py From pyweed with GNU Lesser General Public License v3.0 | 5 votes |
def setupUi(self, SpinnerWidget): SpinnerWidget.setObjectName("SpinnerWidget") SpinnerWidget.resize(306, 207) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(SpinnerWidget.sizePolicy().hasHeightForWidth()) SpinnerWidget.setSizePolicy(sizePolicy) SpinnerWidget.setStyleSheet("QFrame { background-color: rgba(224,224,224,192)} \n" "QLabel { background-color: transparent }") self.verticalLayout = QtWidgets.QVBoxLayout(SpinnerWidget) self.verticalLayout.setSpacing(0) self.verticalLayout.setObjectName("verticalLayout") self.icon = QtWidgets.QLabel(SpinnerWidget) self.icon.setText("") self.icon.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignHCenter) self.icon.setObjectName("icon") self.verticalLayout.addWidget(self.icon) self.label = QtWidgets.QLabel(SpinnerWidget) self.label.setText("") self.label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.cancelButton = QtWidgets.QPushButton(SpinnerWidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.cancelButton.sizePolicy().hasHeightForWidth()) self.cancelButton.setSizePolicy(sizePolicy) self.cancelButton.setObjectName("cancelButton") self.horizontalLayout.addWidget(self.cancelButton) self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout.setStretch(0, 1) self.verticalLayout.setStretch(1, 1) self.retranslateUi(SpinnerWidget) QtCore.QMetaObject.connectSlotsByName(SpinnerWidget)
Example #27
Source File: textinput.py From screenshot with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent=None): super(TextInput, self).__init__(parent) self.setWindowFlags(Qt.Dialog | Qt.FramelessWindowHint) self.mainLayout = QVBoxLayout() self.textArea = QTextEdit(self) self.buttonArea = QWidget(self) self.buttonLayout = QHBoxLayout() self.cancelButton = QPushButton('Cancel', self) self.okButton = QPushButton('Ok', self) self.buttonLayout.addWidget(self.cancelButton) self.buttonLayout.addWidget(self.okButton) self.buttonArea.setLayout(self.buttonLayout) self.mainLayout.addWidget(self.textArea) self.mainLayout.addWidget(self.buttonArea) self.setLayout(self.mainLayout) self.textArea.textChanged.connect(self.textChanged_) self.okButton.clicked.connect(self.okButtonClicked) self.cancelButton.clicked.connect(self.cancelPressed)
Example #28
Source File: toolbar.py From screenshot with GNU General Public License v3.0 | 5 votes |
def initWindow(self, flags): self.hlayout = QHBoxLayout() self.hlayout.setSpacing(2) self.hlayout.setContentsMargins(10, 2, 10, 2) self.setLayout(self.hlayout) self.initDrawButtons(flags) self.initOtherButtons(flags) # slots
Example #29
Source File: intro_dlg.py From mindfulness-at-the-computer with GNU General Public License v3.0 | 5 votes |
def _init_ui(self): title_qll = QtWidgets.QLabel("The breathing dialog") title_qll.setFont(mc.mc_global.get_font_xxlarge(i_bold=True)) title_qll.setAlignment(QtCore.Qt.AlignHCenter) description_qll = QtWidgets.QLabel( "This dialog helps you to relax and return to your breathing. " "Try it out, it is interactive!" ) description_qll.setWordWrap(True) description_qll.setFont(mc.mc_global.get_font_xlarge()) breathing_dlg = mc.gui.breathing_dlg.BreathingDlg() breathing_dlg.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) breathing_dlg._close_qpb.setDisabled(True) vbox_l3 = QtWidgets.QVBoxLayout() vbox_l3.addSpacing(MARGIN_TOP_INT) vbox_l3.addWidget(title_qll) vbox_l3.addWidget(description_qll) vbox_l3.addStretch(1) vbox_l3.addWidget(breathing_dlg) vbox_l3.setSizeConstraint(QtWidgets.QLayout.SetFixedSize) hbox_l2 = QtWidgets.QHBoxLayout() hbox_l2.addStretch(1) hbox_l2.addLayout(vbox_l3) hbox_l2.addStretch(1) self.setLayout(hbox_l2)
Example #30
Source File: gui.py From minesweeper with MIT License | 5 votes |
def init_ui(self): """Setup control widget UI.""" self.control_layout = QHBoxLayout() self.setLayout(self.control_layout) self.reset_button = QPushButton() self.reset_button.setFixedSize(40, 40) self.reset_button.setIcon(QtGui.QIcon(WIN_PATH)) self.game_timer = QLCDNumber() self.game_timer.setStyleSheet("QLCDNumber {color: red;}") self.game_timer.setFixedWidth(100) self.move_counter = QLCDNumber() self.move_counter.setStyleSheet("QLCDNumber {color: red;}") self.move_counter.setFixedWidth(100) self.control_layout.addWidget(self.game_timer) self.control_layout.addWidget(self.reset_button) self.control_layout.addWidget(self.move_counter)