Python PySide2.QtWidgets.QSizePolicy() Examples
The following are 7
code examples of PySide2.QtWidgets.QSizePolicy().
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
PySide2.QtWidgets
, or try the search function
.
Example #1
Source File: onionSkinRendererObjectWidget.py From onionSkinRenderer with MIT License | 6 votes |
def setupUi(self, onionSkinObject_layout): onionSkinObject_layout.setObjectName("onionSkinObject_layout") onionSkinObject_layout.resize(204, 38) self.horizontalLayout = QtWidgets.QHBoxLayout(onionSkinObject_layout) self.horizontalLayout.setSpacing(3) self.horizontalLayout.setContentsMargins(4, 2, 4, 2) self.horizontalLayout.setObjectName("horizontalLayout") self.object_label = QtWidgets.QLabel(onionSkinObject_layout) self.object_label.setObjectName("object_label") self.horizontalLayout.addWidget(self.object_label) self.object_remove_btn = QtWidgets.QPushButton(onionSkinObject_layout) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.object_remove_btn.sizePolicy().hasHeightForWidth()) self.object_remove_btn.setSizePolicy(sizePolicy) self.object_remove_btn.setMinimumSize(QtCore.QSize(16, 16)) self.object_remove_btn.setMaximumSize(QtCore.QSize(16, 16)) self.object_remove_btn.setObjectName("object_remove_btn") self.horizontalLayout.addWidget(self.object_remove_btn) self.retranslateUi(onionSkinObject_layout) QtCore.QMetaObject.connectSlotsByName(onionSkinObject_layout)
Example #2
Source File: onionSkinRendererWindow.py From onionSkinRenderer with MIT License | 5 votes |
def addRemoveButton(self): self.frame_remove_btn = QtWidgets.QPushButton('rm') sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.frame_remove_btn.sizePolicy().hasHeightForWidth()) self.frame_remove_btn.setSizePolicy(sizePolicy) self.frame_remove_btn.setMinimumSize(QtCore.QSize(16, 16)) self.frame_remove_btn.setMaximumSize(QtCore.QSize(16, 16)) self.frame_widget_layout.addWidget(self.frame_remove_btn)
Example #3
Source File: version_updater_UI_pyside2.py From anima with MIT License | 5 votes |
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.setWindowModality(QtCore.Qt.ApplicationModal) Dialog.resize(1304, 753) self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(Dialog) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.versions_treeView = QtWidgets.QTreeView(Dialog) self.versions_treeView.setObjectName("versions_treeView") self.verticalLayout.addWidget(self.versions_treeView) self.horizontalWidget = QtWidgets.QWidget(Dialog) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.horizontalWidget.sizePolicy().hasHeightForWidth()) self.horizontalWidget.setSizePolicy(sizePolicy) self.horizontalWidget.setObjectName("horizontalWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.selectNone_pushButton = QtWidgets.QPushButton(self.horizontalWidget) self.selectNone_pushButton.setObjectName("selectNone_pushButton") self.horizontalLayout.addWidget(self.selectNone_pushButton) self.selectAll_pushButton = QtWidgets.QPushButton(self.horizontalWidget) self.selectAll_pushButton.setObjectName("selectAll_pushButton") self.horizontalLayout.addWidget(self.selectAll_pushButton) self.update_pushButton = QtWidgets.QPushButton(self.horizontalWidget) self.update_pushButton.setObjectName("update_pushButton") self.horizontalLayout.addWidget(self.update_pushButton) self.cancel_pushButton = QtWidgets.QPushButton(self.horizontalWidget) self.cancel_pushButton.setObjectName("cancel_pushButton") self.horizontalLayout.addWidget(self.cancel_pushButton) self.verticalLayout.addWidget(self.horizontalWidget) self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
Example #4
Source File: Dialog_text.py From Sonoff_Devices_DIY_Tools with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, parent=None, **info): super(resultDialog, self).__init__(parent) print("后:%s" % str(info["info"])) all_info = info["info"] self.setWindowTitle('result') self.resize(200, 100) self.setWindowModality(Qt.ApplicationModal) grid = QGridLayout() num = 0 for x in all_info.keys(): sub_name = QLabel(parent=self) sub_name.setText(x) grid.addWidget(sub_name, num, 0, 1, 1) sub_ret = QLabel(parent=self) data = all_info[x] if data['error'] == 0: sub_ret.setText("succeed") else: sub_ret.setText("error") grid.addWidget(sub_ret, num, 1, 1, 1) sub_info = QLabel(parent=self) sub_info.setText(str(all_info[x])) grid.addWidget(sub_info, num, 2, 2, 1) num += 1 buttonbox = QDialogButtonBox(parent=self) buttonbox.setOrientation(Qt.Horizontal) buttonbox.setStandardButtons( QDialogButtonBox.Cancel | QDialogButtonBox.Ok) buttonbox.accepted.connect(self.accept) buttonbox.rejected.connect(self.reject) layout = QVBoxLayout() layout.addLayout(grid) spacerItem = QSpacerItem( 20, 48, QSizePolicy.Minimum, QSizePolicy.Expanding) layout.addItem(spacerItem) layout.addWidget(buttonbox) self.setLayout(layout)
Example #5
Source File: Dialog_text.py From Sonoff_Devices_DIY_Tools with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, parent=None): super(myDialog, self).__init__(parent) # Sets the title and size of the dialog box self.setWindowTitle('myDialog') self.resize(200, 100) # Set the window to modal, and the user can only close the main # interface after closing the popover self.setWindowModality(Qt.ApplicationModal) # Table layout used to layout QLabel and QLineEdit and QSpinBox grid = QGridLayout() grid.addWidget(QLabel(u'SSID', parent=self), 0, 0, 1, 1) self.SSIDName = QLineEdit(parent=self) self.SSIDName.setText("wifi") grid.addWidget(self.SSIDName, 0, 1, 1, 1) grid.addWidget(QLabel(u'password', parent=self), 1, 0, 1, 1) self.WIFIpassword = QLineEdit(parent=self) self.WIFIpassword.setText("password") grid.addWidget(self.WIFIpassword, 1, 1, 1, 1) grid.addWidget(QLabel(u'password', parent=self), 2, 0, 2, 2) # Create ButtonBox, and the user confirms and cancels buttonbox = QDialogButtonBox(parent=self) buttonbox.setOrientation(Qt.Horizontal) buttonbox.setStandardButtons( QDialogButtonBox.Cancel | QDialogButtonBox.Ok) buttonbox.accepted.connect(self.accept) buttonbox.rejected.connect(self.reject) # Vertical layout, layout tables and buttons layout = QVBoxLayout() # Add the table layout you created earlier layout.addLayout(grid) # Put a space object to beautify the layout spacerItem = QSpacerItem( 20, 48, QSizePolicy.Minimum, QSizePolicy.Expanding) layout.addItem(spacerItem) # ButtonBox layout.addWidget(buttonbox) self.setLayout(layout)
Example #6
Source File: ui_mainwindow.py From Il2cppSpy with MIT License | 4 votes |
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(800, 600) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.splitter = QtWidgets.QSplitter(self.centralwidget) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setHandleWidth(2) self.splitter.setObjectName("splitter") self.treeWidget = QtWidgets.QTreeWidget(self.splitter) self.treeWidget.setObjectName("treeWidget") self.treeWidget.headerItem().setText(0, "1") self.treeWidget.header().setVisible(False) self.tabWidget = QtWidgets.QTabWidget(self.splitter) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(1) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth()) self.tabWidget.setSizePolicy(sizePolicy) self.tabWidget.setDocumentMode(True) self.tabWidget.setTabsClosable(True) self.tabWidget.setMovable(True) self.tabWidget.setObjectName("tabWidget") self.verticalLayout.addWidget(self.splitter) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar() self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 22)) self.menubar.setObjectName("menubar") self.menuFile = QtWidgets.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.toolBar = QtWidgets.QToolBar(MainWindow) self.toolBar.setIconSize(QtCore.QSize(18, 18)) self.toolBar.setObjectName("toolBar") MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) self.actionOpenFile = QtWidgets.QAction(MainWindow) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/folder.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionOpenFile.setIcon(icon) self.actionOpenFile.setObjectName("actionOpenFile") self.actionCompareFiles = QtWidgets.QAction(MainWindow) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/file.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionCompareFiles.setIcon(icon1) self.actionCompareFiles.setObjectName("actionCompareFiles") self.menuFile.addAction(self.actionOpenFile) self.menuFile.addAction(self.actionCompareFiles) self.menubar.addAction(self.menuFile.menuAction()) self.toolBar.addAction(self.actionOpenFile) self.toolBar.addAction(self.actionCompareFiles) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
Example #7
Source File: Dialog_text.py From Sonoff_Devices_DIY_Tools with BSD 3-Clause "New" or "Revised" License | 4 votes |
def __init__(self, parent=None): super(WIFIDialog, self).__init__(parent) # Sets the title and size of the dialog box self.setWindowTitle('Connect to a new WIFI') self.resize(200, 100) # Set the window to modal, and the user can only close the main # interface after closing the popover self.setWindowModality(Qt.ApplicationModal) # Table layout used to layout QLabel and QLineEdit and QSpinBox grid = QGridLayout() grid.addWidget(QLabel(u'SSID', parent=self), 0, 0, 1, 1) self.SSIDName = QLineEdit(parent=self) self.SSIDName.setText("SSID") grid.addWidget(self.SSIDName, 0, 1, 1, 1) grid.addWidget(QLabel(u'password', parent=self), 1, 0, 1, 1) self.WIFIpassword = QLineEdit(parent=self) self.WIFIpassword.setText("password") grid.addWidget(self.WIFIpassword, 1, 1, 1, 1) grid.addWidget( QLabel( u'Please enter the SSID and password of the new wifi your device will connect.After connected,\n the ' u'device will no longer be on this LAN and info in the list will be refreshed in 5 mins.', parent=self), 2, 0, 2, 2) # Create ButtonBox, and the user confirms and cancels buttonbox = QDialogButtonBox(parent=self) buttonbox.setOrientation(Qt.Horizontal) buttonbox.setStandardButtons( QDialogButtonBox.Cancel | QDialogButtonBox.Ok) buttonbox.accepted.connect(self.accept) buttonbox.rejected.connect(self.reject) # Vertical layout, layout tables and buttons layout = QVBoxLayout() # Add the table layout you created earlier layout.addLayout(grid) # Put a space object to beautify the layout spacer = QSpacerItem( 20, 48, QSizePolicy.Minimum, QSizePolicy.Expanding) layout.addItem(spacer) # ButtonBox layout.addWidget(buttonbox) self.setLayout(layout)