Python PyQt5.QtCore.QSize() Examples
The following are 30
code examples of PyQt5.QtCore.QSize().
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.QtCore
, or try the search function
.
Example #1
Source File: breathing_phrase_list_wt.py From mindfulness-at-the-computer with GNU General Public License v3.0 | 10 votes |
def update_gui(self, i_event_source=mc.mc_global.EventSource.undefined): self.updating_gui_bool = True # If the list is now empty, disabling buttons # If the list is no longer empty, enable buttons self.set_button_states(mc.model.PhrasesM.is_empty()) # List self.list_widget.clear() for l_phrase in mc.model.PhrasesM.get_all(): # self.list_widget.addItem(l_collection.title_str) custom_label = CustomQLabel(l_phrase.title, l_phrase.id) list_item = QtWidgets.QListWidgetItem() list_item.setSizeHint(QtCore.QSize(list_item.sizeHint().width(), mc_global.LIST_ITEM_HEIGHT_INT)) self.list_widget.addItem(list_item) self.list_widget.setItemWidget(list_item, custom_label) if i_event_source == mc.mc_global.EventSource.breathing_phrase_deleted: self.update_selected(0) else: self.update_selected() self.updating_gui_bool = False
Example #2
Source File: quickplotter.py From phidl with MIT License | 6 votes |
def mousePressEvent(self, event): super(QGraphicsView, self).mousePressEvent(event) #============================================================================== # Zoom to rectangle, from # https://wiki.python.org/moin/PyQt/Selecting%20a%20region%20of%20a%20widget #============================================================================== if event.button() == Qt.RightButton: self._mousePressed = Qt.RightButton self._rb_origin = QPoint(event.pos()) self.rubberBand.setGeometry(QRect(self._rb_origin, QSize())) self.rubberBand.show() #============================================================================== # Mouse panning, taken from # http://stackoverflow.com/a/15043279 #============================================================================== elif event.button() == Qt.MidButton: self._mousePressed = Qt.MidButton self._mousePressedPos = event.pos() self.setCursor(QtCore.Qt.ClosedHandCursor) self._dragPos = event.pos()
Example #3
Source File: WBarOut.py From pyleecan with Apache License 2.0 | 6 votes |
def __init__(self, parent=None): """Initialize the widget """ # Main widget setup QWidget.__init__(self, parent) self.u = gui_option.unit self.setTitle(self.tr("Output")) self.setMinimumSize(QSize(200, 0)) self.setObjectName("g_output") self.layout = QVBoxLayout(self) self.layout.setObjectName("layout") # The widget is composed of 3 QLabel in a vertical layout self.out_Sbar = QLabel(self) self.out_Sbar.setObjectName("out_Sbar") self.layout.addWidget(self.out_Sbar) self.out_Sslot = QLabel(self) self.out_Sslot.setObjectName("out_Sslot") self.layout.addWidget(self.out_Sslot) self.out_ratio = QLabel(self) self.out_ratio.setMinimumSize(QSize(140, 0)) self.out_ratio.setObjectName("out_ratio") self.layout.addWidget(self.out_ratio)
Example #4
Source File: window_ui.py From detection with GNU General Public License v2.0 | 6 votes |
def widgetGlobalParam(self): """Create global parameters widget. """ hbox = QHBoxLayout() self.displayCBox = QComboBox(self) self.bgCBox = QComboBox(self) self.bgColorPicker = QPushButton('') self.bgColorPicker.setMaximumSize(QtCore.QSize(16, 16)) self.bgPathButton = QPushButton('...') self.bgPathButton.setMaximumWidth(45) hbox.addWidget(QLabel(self.tr('Display'))) hbox.addWidget(self.displayCBox) hbox.addStretch(1) hbox.addWidget(QLabel(self.tr('Background'))) hbox.addWidget(self.bgCBox) hbox.addWidget(self.bgColorPicker) hbox.addWidget(self.bgPathButton) self.equalizeHist = QCheckBox(self.tr('Equalize histogram')) vbox = QVBoxLayout() vbox.addLayout(hbox) vbox.addWidget(self.equalizeHist) return vbox
Example #5
Source File: test_miscwidgets.py From qutebrowser with GNU General Public License v3.0 | 6 votes |
def test_read_size(self, config, width, height, position, expected_size, state_config, splitter, fake_inspector, caplog): if config is not None: state_config['inspector'] = {position.name: config} splitter.resize(width, height) assert splitter.size() == QSize(width, height) with caplog.at_level(logging.ERROR): splitter.set_inspector(fake_inspector, position) assert splitter._preferred_size == expected_size if config == {'left': 'verybig'}: assert caplog.messages == ["Could not read inspector size: " "invalid literal for int() with " "base 10: 'verybig'"]
Example #6
Source File: test_miscwidgets.py From qutebrowser with GNU General Public License v3.0 | 6 votes |
def test_adjust_size(self, old_window_size, preferred_size, new_window_size, exp_inspector_size, position, splitter, fake_inspector, qtbot): def resize(dim): size = (QSize(dim, 666) if splitter.orientation() == Qt.Horizontal else QSize(666, dim)) splitter.resize(size) if splitter.size() != size: pytest.skip("Resizing window failed") splitter.set_inspector(fake_inspector, position) splitter.show() resize(old_window_size) handle_width = 4 splitter.setHandleWidth(handle_width) splitter_idx = 1 if position in [inspector.Position.left, inspector.Position.top]: splitter_pos = preferred_size - handle_width//2 else: splitter_pos = old_window_size - preferred_size - handle_width//2 splitter.moveSplitter(splitter_pos, splitter_idx) resize(new_window_size) sizes = splitter.sizes() inspector_size = sizes[splitter._inspector_idx] main_size = sizes[splitter._main_idx] exp_main_size = new_window_size - exp_inspector_size exp_main_size -= handle_width // 2 exp_inspector_size -= handle_width // 2 assert (inspector_size, main_size) == (exp_inspector_size, exp_main_size)
Example #7
Source File: completionwidget.py From qutebrowser with GNU General Public License v3.0 | 6 votes |
def sizeHint(self): """Get the completion size according to the config.""" # Get the configured height/percentage. confheight = str(config.val.completion.height) if confheight.endswith('%'): perc = int(confheight.rstrip('%')) height = self.window().height() * perc // 100 else: height = int(confheight) # Shrink to content size if needed and shrinking is enabled if config.val.completion.shrink: contents_height = ( self.viewportSizeHint().height() + self.horizontalScrollBar().sizeHint().height()) if contents_height <= height: height = contents_height # The width isn't really relevant as we're expanding anyways. return QSize(-1, height)
Example #8
Source File: about.py From persepolis with GNU General Public License v3.0 | 6 votes |
def __init__(self, persepolis_setting): super().__init__(persepolis_setting) self.persepolis_setting = persepolis_setting # setting window size and position size = self.persepolis_setting.value( 'AboutWindow/size', QSize(545, 375)) position = self.persepolis_setting.value( 'AboutWindow/position', QPoint(300, 300)) # read translators.txt files. # this file contains all translators. f = QFile(':/translators.txt') f.open(QIODevice.ReadOnly | QFile.Text) f_text = QTextStream(f).readAll() f.close() self.translators_textEdit.insertPlainText(f_text) self.resize(size) self.move(position)
Example #9
Source File: window_ui.py From detection with GNU General Public License v2.0 | 6 votes |
def widgetClassifierDisplay(self): """Create classifier display widget. """ self.colorPicker = QPushButton('') self.colorPicker.setMaximumSize(QtCore.QSize(16, 16)) self.shapeCBox = QComboBox(self) self.fillCBox = QComboBox(self) self.fillPath = QPushButton('...') self.fillPath.setMaximumWidth(40) self.showName = QCheckBox(self.tr('Show Name')) hbox = QHBoxLayout() hbox.addWidget(QLabel(self.tr('Shape'))) hbox.addWidget(self.shapeCBox) hbox.addWidget(self.fillCBox) hbox.addWidget(self.fillPath) hbox.addWidget(self.colorPicker) hbox.addStretch(1) vbox = QVBoxLayout() vbox.addWidget(self.showName) vbox.addLayout(hbox) return vbox
Example #10
Source File: table.py From dunya-desktop with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent): QDialog.__init__(self, parent=parent) self.setMinimumSize(QSize(1200, 600)) layout = QVBoxLayout(self) self.label_collection = QLabel() self.label_collection.setAlignment(Qt.AlignCenter) layout.addWidget(self.label_collection) self.lineedit_filter = QLineEdit(self) layout.addWidget(self.lineedit_filter) self.coll_table = TableViewCollections(self) layout.addWidget(self.coll_table) self.model = CollectionTableModel() self.proxy_model = SortFilterProxyModel() self.proxy_model.setSourceModel(self.model) self.proxy_model.setFilterKeyColumn(-1) self.coll_table.setModel(self.proxy_model) # signals self.lineedit_filter.textChanged.connect(self._lineedit_changed)
Example #11
Source File: library.py From Lector with GNU General Public License v3.0 | 6 votes |
def generate_proxymodels(self): self.itemProxyModel = ItemProxyModel() self.itemProxyModel.setSourceModel(self.libraryModel) self.itemProxyModel.setSortCaseSensitivity(False) s = QtCore.QSize(160, 250) # Set icon sizing here self.main_window.listView.setIconSize(s) self.main_window.listView.setModel(self.itemProxyModel) self.tableProxyModel = TableProxyModel( self.main_window.temp_dir.path(), self.main_window.tableView.horizontalHeader(), self.main_window.settings['consider_read_at']) self.tableProxyModel.setSourceModel(self.libraryModel) self.tableProxyModel.setSortCaseSensitivity(False) self.main_window.tableView.setModel(self.tableProxyModel) self.update_proxymodels()
Example #12
Source File: WMagnetOut.py From pyleecan with Apache License 2.0 | 5 votes |
def __init__(self, parent=None): """Initialize the widget """ QWidget.__init__(self, parent) self.u = gui_option.unit # Setup main widget self.setTitle(self.tr("Output")) self.setMinimumSize(QSize(200, 0)) self.setObjectName("g_output") self.layout = QVBoxLayout(self) self.layout.setObjectName("layout") # The widget is composed of several QLabel in a vertical layout self.out_Smag = QLabel(self) self.out_Smag.setObjectName("out_Smag") self.layout.addWidget(self.out_Smag) self.out_gap = QLabel(self) self.out_gap.setObjectName("out_gap") self.layout.addWidget(self.out_gap) self.out_gap_min = QLabel(self) self.out_gap_min.setObjectName("out_gap_min") self.layout.addWidget(self.out_gap_min) self.out_taum = QLabel(self) self.out_taum.setObjectName("out_taum") self.layout.addWidget(self.out_taum)
Example #13
Source File: interSubs.py From interSubs with MIT License | 5 votes |
def sizeHint(self): return QSize( self.fontMetrics().width(self.line), self.fontMetrics().height() )
Example #14
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 #15
Source File: WCondOut.py From pyleecan with Apache License 2.0 | 5 votes |
def __init__(self, parent=None): """Initialize the widget """ QWidget.__init__(self, parent) # Set main widget self.u = gui_option.unit self.setTitle(self.tr("Output")) self.setMinimumSize(QSize(200, 0)) self.setObjectName("g_output") self.layout = QVBoxLayout(self) self.layout.setObjectName("layout") # The widget is composed of several QLabel in a vertical layout self.out_H = QLabel(self) self.out_H.setObjectName("out_H") self.layout.addWidget(self.out_H) self.out_W = QLabel(self) self.out_W.setObjectName("out_W") self.layout.addWidget(self.out_W) self.out_S = QLabel(self) self.out_S.setObjectName("out_S") self.layout.addWidget(self.out_S) self.out_Sact = QLabel(self) self.out_Sact.setObjectName("out_Sact") self.layout.addWidget(self.out_Sact) self.out_K = QLabel(self) self.out_K.setObjectName("out_K") self.layout.addWidget(self.out_K)
Example #16
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 #17
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 #18
Source File: common.py From detection with GNU General Public License v2.0 | 5 votes |
def fitImageToScreen(pixmap): """Fit pixmap to screen. """ resolution = QDesktopWidget().screenGeometry() h, w = resolution.width(), resolution.height() w = min(pixmap.width(), w) h = min(pixmap.height(), h) return pixmap.scaled(QtCore.QSize(w, h), QtCore.Qt.KeepAspectRatio)
Example #19
Source File: dockwidget.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def _set_label_corpus(self): """Sets the label""" font = QFont() font.setFamily("Garuda") self.label_corpus.setFont(font) size_policy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) size_policy.setHeightForWidth( self.label_corpus.sizePolicy().hasHeightForWidth()) self.label_corpus.setSizePolicy(size_policy) self.label_corpus.setMinimumSize(QSize(300, 30)) self.label_corpus.setMaximumSize(QSize(700, 30))
Example #20
Source File: dockwidget.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def _set_frame_downloaded(self): """Sets the size policies of the downloaded features frame.""" self.frame_downloaded = QFrame(self) size_policy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred) size_policy.setHorizontalStretch(0) size_policy.setVerticalStretch(0) size_policy.setHeightForWidth( self.frame_downloaded.sizePolicy().hasHeightForWidth()) self.frame_downloaded.setSizePolicy(size_policy) self.frame_downloaded.setMinimumSize(QSize(0, 150)) self.frame_downloaded.setBaseSize(QSize(0, 100)) self.frame_downloaded.setFrameShape(QFrame.StyledPanel) self.frame_downloaded.setFrameShadow(QFrame.Raised)
Example #21
Source File: dockwidget.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def _set_toolbutton(self, button): """Sets the size policies of the new collection button.""" size_policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) size_policy.setHorizontalStretch(0) size_policy.setVerticalStretch(0) size_policy.setHeightForWidth(button.sizePolicy().hasHeightForWidth()) button.setSizePolicy(size_policy) button.setMinimumSize(QSize(0, 30)) button.setMaximumSize(QSize(16777215, 30)) button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) button.setAutoRaise(True) button.setArrowType(Qt.NoArrow)
Example #22
Source File: dockwidget.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def _set_frame(self): """Sets the size policies of the frame.""" size_policy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred) # size_policy.setHorizontalStretch(0) # size_policy.setVerticalStretch(0) # size_policy.setHeightForWidth( # self.frame_collection.sizePolicy().hasHeightForWidth()) self.frame_collection.setSizePolicy(size_policy) # self.frame_collection.setMinimumSize(QSize(0, 200)) # self.frame_collection.setMaximumSize(QSize(16777215, 200)) # self.frame_collection.setBaseSize(QSize(10, 10)) self.frame_collection.setFrameShape(QFrame.Box) # self.frame_collection.setFrameShadow(QFrame.Raised)
Example #23
Source File: dockwidget.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def _set_widget(self): """Sets the size policies.""" size_policy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred) size_policy.setHorizontalStretch(0) size_policy.setVerticalStretch(0) size_policy.setHeightForWidth(self.sizePolicy().hasHeightForWidth()) self.setSizePolicy(size_policy) self.setMaximumSize(QSize(500, 16777215))
Example #24
Source File: histogram.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def __init__(self): super(HistogramDialog, self).__init__() self.setMinimumSize(QSize(500, 325)) self.setContentsMargins(0, 0, 0, 0) self.hist_widget = pg.PlotWidget(self) l = QVBoxLayout(self) l.addWidget(self.hist_widget) l.setContentsMargins(0, 0, 0, 0)
Example #25
Source File: Ui_WMatSelect.py From pyleecan with Apache License 2.0 | 5 votes |
def setupUi(self, WMatSelect): WMatSelect.setObjectName("WMatSelect") WMatSelect.resize(283, 30) sizePolicy = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum ) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(WMatSelect.sizePolicy().hasHeightForWidth()) WMatSelect.setSizePolicy(sizePolicy) WMatSelect.setMinimumSize(QtCore.QSize(0, 0)) self.horizontalLayout = QtWidgets.QHBoxLayout(WMatSelect) self.horizontalLayout.setContentsMargins(4, 2, 4, 2) self.horizontalLayout.setSpacing(2) self.horizontalLayout.setObjectName("horizontalLayout") self.in_mat_type = QtWidgets.QLabel(WMatSelect) self.in_mat_type.setObjectName("in_mat_type") self.horizontalLayout.addWidget(self.in_mat_type) self.c_mat_type = QtWidgets.QComboBox(WMatSelect) self.c_mat_type.setObjectName("c_mat_type") self.c_mat_type.addItem("") self.c_mat_type.addItem("") self.c_mat_type.addItem("") self.horizontalLayout.addWidget(self.c_mat_type) self.b_matlib = QtWidgets.QPushButton(WMatSelect) self.b_matlib.setObjectName("b_matlib") self.horizontalLayout.addWidget(self.b_matlib) self.retranslateUi(WMatSelect) QtCore.QMetaObject.connectSlotsByName(WMatSelect) WMatSelect.setTabOrder(self.c_mat_type, self.b_matlib)
Example #26
Source File: constraints.py From IDAngr with BSD 2-Clause "Simplified" License | 5 votes |
def setupUi(self, IDAngrConstraintsDialog): IDAngrConstraintsDialog.setObjectName("IDAngrConstraintsDialog") IDAngrConstraintsDialog.resize(811, 599) self.gridLayout_2 = QtWidgets.QGridLayout(IDAngrConstraintsDialog) self.gridLayout_2.setObjectName("gridLayout_2") self.constrEdit = QtWidgets.QPlainTextEdit(IDAngrConstraintsDialog) self.constrEdit.setEnabled(True) self.constrEdit.setObjectName("constrEdit") self.gridLayout_2.addWidget(self.constrEdit, 0, 0, 1, 1) self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.savedsBtn = QtWidgets.QPushButton(IDAngrConstraintsDialog) self.savedsBtn.setEnabled(True) self.savedsBtn.setObjectName("savedsBtn") self.gridLayout.addWidget(self.savedsBtn, 0, 0, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(IDAngrConstraintsDialog) self.buttonBox.setMinimumSize(QtCore.QSize(0, 48)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 0, 1, 1, 1) self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 1, 1) self.retranslateUi(IDAngrConstraintsDialog) self.buttonBox.accepted.connect(IDAngrConstraintsDialog.accept) self.buttonBox.rejected.connect(IDAngrConstraintsDialog.reject) QtCore.QMetaObject.connectSlotsByName(IDAngrConstraintsDialog)
Example #27
Source File: general_design.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def _set_status_bar(self): self.statusbar.setMinimumSize(QtCore.QSize(0, 18)) font = QFont() font.setPointSize(9) self.statusbar.setFont(font)
Example #28
Source File: general_design.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def _set_main_window(self): """Sets the size policies of the main window""" self.resize(1000, 750) size_policy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) size_policy.setHorizontalStretch(0) size_policy.setVerticalStretch(0) size_policy.setHeightForWidth(self.sizePolicy().hasHeightForWidth()) self.setSizePolicy(size_policy) self.setMinimumSize(QtCore.QSize(1000, 750)) # main window icon self.setWindowIcon(QIcon(DUNYA_ICON)) self.setWindowTitle('Dunya Desktop')
Example #29
Source File: saveds.py From IDAngr with BSD 2-Clause "Simplified" License | 5 votes |
def setupUi(self, IDAngrSavedsDialog): IDAngrSavedsDialog.setObjectName("IDAngrSavedsDialog") IDAngrSavedsDialog.resize(941, 569) self.gridLayout = QtWidgets.QGridLayout(IDAngrSavedsDialog) self.gridLayout.setObjectName("gridLayout") self.splitter = QtWidgets.QSplitter(IDAngrSavedsDialog) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName("splitter") self.selectorList = QtWidgets.QListView(self.splitter) self.selectorList.setMaximumSize(QtCore.QSize(270, 16777215)) self.selectorList.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.selectorList.setObjectName("selectorList") self.codeView = QtWidgets.QPlainTextEdit(self.splitter) self.codeView.setReadOnly(True) self.codeView.setObjectName("codeView") self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(IDAngrSavedsDialog) self.buttonBox.setMaximumSize(QtCore.QSize(16777215, 48)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1) self.retranslateUi(IDAngrSavedsDialog) self.buttonBox.accepted.connect(IDAngrSavedsDialog.accept) self.buttonBox.rejected.connect(IDAngrSavedsDialog.reject) QtCore.QMetaObject.connectSlotsByName(IDAngrSavedsDialog)
Example #30
Source File: newcollectiondialog.py From dunya-desktop with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent): QDialog.__init__(self, parent) self._set_dialog() layout = QGridLayout(self) layout.setContentsMargins(0, 2, 0, 1) layout.setHorizontalSpacing(0) layout.setVerticalSpacing(2) self.coll_edit = QLineEdit(self) self.coll_edit.setMaximumSize(QSize(16777215, 40)) layout.addWidget(self.coll_edit, 1, 0, 1, 1) self.desc_edit = QTextEdit(self) self._set_desc_edit() layout.addWidget(self.desc_edit, 3, 0, 1, 1) self.label_name = QLabel(self) self.label_name.setText('Name') layout.addWidget(self.label_name, 0, 0, 1, 1) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) layout.addWidget(self.buttonBox, 7, 0, 1, 1) self.label_description = QLabel(self) self.label_description.setText('Description') layout.addWidget(self.label_description, 2, 0, 1, 1) self.buttonBox.rejected.connect(self.clicked_cancel) self.buttonBox.accepted.connect(self.clicked_ok)