本文整理匯總了Python中Qt.QtWidgets.QSpacerItem方法的典型用法代碼示例。如果您正苦於以下問題:Python QtWidgets.QSpacerItem方法的具體用法?Python QtWidgets.QSpacerItem怎麽用?Python QtWidgets.QSpacerItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Qt.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QSpacerItem方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setupUi
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(228, 30)
self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
self.horizontalLayout.setSpacing(1)
self.horizontalLayout.setContentsMargins(1, 1, 1, 1)
self.horizontalLayout.setObjectName("horizontalLayout")
self.widget = QtWidgets.QWidget(Form)
self.widget.setObjectName("widget")
self.horizontalLayout.addWidget(self.widget)
self.labelName = QtWidgets.QLabel(Form)
self.labelName.setObjectName("labelName")
self.horizontalLayout.addWidget(self.labelName)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.pbKill = QtWidgets.QPushButton(Form)
self.pbKill.setMaximumSize(QtCore.QSize(40, 16777215))
self.pbKill.setText("")
self.pbKill.setObjectName("pbKill")
self.horizontalLayout.addWidget(self.pbKill)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例2: setupUi
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, QSpectrumAnalyzerPersistence):
QSpectrumAnalyzerPersistence.setObjectName("QSpectrumAnalyzerPersistence")
QSpectrumAnalyzerPersistence.resize(250, 130)
self.verticalLayout = QtWidgets.QVBoxLayout(QSpectrumAnalyzerPersistence)
self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setObjectName("formLayout")
self.label_2 = QtWidgets.QLabel(QSpectrumAnalyzerPersistence)
self.label_2.setObjectName("label_2")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
self.decayFunctionComboBox = QtWidgets.QComboBox(QSpectrumAnalyzerPersistence)
self.decayFunctionComboBox.setObjectName("decayFunctionComboBox")
self.decayFunctionComboBox.addItem("")
self.decayFunctionComboBox.addItem("")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.decayFunctionComboBox)
self.label = QtWidgets.QLabel(QSpectrumAnalyzerPersistence)
self.label.setObjectName("label")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label)
self.persistenceLengthSpinBox = QtWidgets.QSpinBox(QSpectrumAnalyzerPersistence)
self.persistenceLengthSpinBox.setProperty("value", 5)
self.persistenceLengthSpinBox.setObjectName("persistenceLengthSpinBox")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.persistenceLengthSpinBox)
self.verticalLayout.addLayout(self.formLayout)
spacerItem = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.buttonBox = QtWidgets.QDialogButtonBox(QSpectrumAnalyzerPersistence)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.label_2.setBuddy(self.decayFunctionComboBox)
self.label.setBuddy(self.persistenceLengthSpinBox)
self.retranslateUi(QSpectrumAnalyzerPersistence)
self.decayFunctionComboBox.setCurrentIndex(1)
self.buttonBox.accepted.connect(QSpectrumAnalyzerPersistence.accept)
self.buttonBox.rejected.connect(QSpectrumAnalyzerPersistence.reject)
QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerPersistence)
QSpectrumAnalyzerPersistence.setTabOrder(self.decayFunctionComboBox, self.persistenceLengthSpinBox)
QSpectrumAnalyzerPersistence.setTabOrder(self.persistenceLengthSpinBox, self.buttonBox)
示例3: setupUi
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, QSpectrumAnalyzerBaseline):
QSpectrumAnalyzerBaseline.setObjectName("QSpectrumAnalyzerBaseline")
QSpectrumAnalyzerBaseline.resize(500, 100)
self.verticalLayout = QtWidgets.QVBoxLayout(QSpectrumAnalyzerBaseline)
self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setObjectName("formLayout")
self.label = QtWidgets.QLabel(QSpectrumAnalyzerBaseline)
self.label.setObjectName("label")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.baselineFileEdit = QtWidgets.QLineEdit(QSpectrumAnalyzerBaseline)
self.baselineFileEdit.setObjectName("baselineFileEdit")
self.horizontalLayout.addWidget(self.baselineFileEdit)
self.baselineFileButton = QtWidgets.QToolButton(QSpectrumAnalyzerBaseline)
self.baselineFileButton.setMinimumSize(QtCore.QSize(50, 0))
self.baselineFileButton.setObjectName("baselineFileButton")
self.horizontalLayout.addWidget(self.baselineFileButton)
self.formLayout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout)
self.verticalLayout.addLayout(self.formLayout)
spacerItem = QtWidgets.QSpacerItem(20, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.buttonBox = QtWidgets.QDialogButtonBox(QSpectrumAnalyzerBaseline)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.label.setBuddy(self.baselineFileEdit)
self.retranslateUi(QSpectrumAnalyzerBaseline)
self.buttonBox.accepted.connect(QSpectrumAnalyzerBaseline.accept)
self.buttonBox.rejected.connect(QSpectrumAnalyzerBaseline.reject)
QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerBaseline)
QSpectrumAnalyzerBaseline.setTabOrder(self.baselineFileEdit, self.baselineFileButton)
示例4: __init__
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def __init__(self, parent=None, dataSetCallback=None, defaultValue=None, **kwds):
super(InputWidgetSingle, self).__init__(parent=parent, dataSetCallback=dataSetCallback,
defaultValue=defaultValue, **kwds)
self.horizontalLayout = QHBoxLayout(self)
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self._index = 0
self._widget = None
self.senderPin = None
示例5: setupUi
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def setupUi(self):
self.resize(400, 300)
self.mainVLayout = QtWidgets.QVBoxLayout(self)
self.mainVLayout.setSpacing(2)
self.mainVLayout.setContentsMargins(2, 2, 2, 2)
self.mainVLayout.setObjectName("mainVLayout")
self.mainVLayout.setSizeConstraint(QtWidgets.QLayout.SetMinAndMaxSize)
self.pbHead = HeadButton(self)
self.mainVLayout.addWidget(self.pbHead)
self.setMinimumHeight(30)
self.ContentWidget = QtWidgets.QWidget(self)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ContentWidget.sizePolicy().hasHeightForWidth())
self.ContentWidget.setSizePolicy(sizePolicy)
self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred))
self.ContentWidget.setObjectName("ContentWidget")
self.ContentWidget.setContentsMargins(10, 0, 0, 0)
self.mainVLayout.addWidget(self.ContentWidget)
self.spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.mainVLayout.addItem(self.spacerItem)
self.setWindowTitle(self.objectName())
self.pbHead.setStyleSheet(self.pbHead.styleSheet() + "\nText-align:left;")
self.contentHiddenIcon = self.pbHead.style().standardIcon(QtWidgets.QStyle.SP_TitleBarUnshadeButton)
self.contentVisibleIcon = self.pbHead.style().standardIcon(QtWidgets.QStyle.SP_TitleBarShadeButton)
self.updateIcon()
示例6: __init__
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def __init__(self, rawVariable, variablesWidget, parent=None):
super(UIVariable, self).__init__(parent)
self._rawVariable = rawVariable
self.variablesWidget = variablesWidget
# ui
self.horizontalLayout = QHBoxLayout(self)
self.horizontalLayout.setSpacing(1)
self.horizontalLayout.setContentsMargins(1, 1, 1, 1)
self.horizontalLayout.setObjectName("horizontalLayout")
self.widget = TypeWidget(findPinClassByType(self._rawVariable.dataType).color(), self)
self.widget.setObjectName("widget")
self.horizontalLayout.addWidget(self.widget)
self.labelName = QLabel(self)
self.labelName.setStyleSheet("background:transparent")
self.labelName.setObjectName("labelName")
self.horizontalLayout.addWidget(self.labelName)
spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
# find refs
self.pbFindRefs = QPushButton("")
self.pbFindRefs.setIcon(QtGui.QIcon(":/searching-magnifying-glass.png"))
self.pbFindRefs.setObjectName("pbFindRefs")
self.horizontalLayout.addWidget(self.pbFindRefs)
self.pbFindRefs.clicked.connect(self.onFindRefsClicked)
# kill variable
self.pbKill = QPushButton("")
self.pbKill.setIcon(QtGui.QIcon(":/delete_icon.png"))
self.pbKill.setObjectName("pbKill")
self.horizontalLayout.addWidget(self.pbKill)
self.pbKill.clicked.connect(self.onKillClicked)
QtCore.QMetaObject.connectSlotsByName(self)
self.setName(self._rawVariable.name)
self._rawVariable.setWrapper(self)
示例7: setupUi
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(341, 363)
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
self.verticalLayout.setSpacing(1)
self.verticalLayout.setContentsMargins(1, 1, 1, 1)
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(Form)
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.pbNewVar = QtWidgets.QPushButton(Form)
self.pbNewVar.setMaximumSize(QtCore.QSize(50, 16777215))
self.pbNewVar.setObjectName("pbNewVar")
self.horizontalLayout.addWidget(self.pbNewVar)
self.verticalLayout.addLayout(self.horizontalLayout)
self.wListWidget = QtWidgets.QWidget(Form)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.wListWidget.sizePolicy().hasHeightForWidth())
self.wListWidget.setSizePolicy(sizePolicy)
self.wListWidget.setObjectName("wListWidget")
self.gridLayout = QtWidgets.QGridLayout(self.wListWidget)
self.gridLayout.setContentsMargins(1, 1, 1, 1)
self.gridLayout.setObjectName("gridLayout")
self.lytListWidget = QtWidgets.QVBoxLayout()
self.lytListWidget.setContentsMargins(0, 0, 0, 0)
self.lytListWidget.setObjectName("lytListWidget")
self.gridLayout.addLayout(self.lytListWidget, 0, 0, 1, 1)
self.verticalLayout.addWidget(self.wListWidget)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例8: setupUi
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, QSpectrumAnalyzerSmoothing):
QSpectrumAnalyzerSmoothing.setObjectName("QSpectrumAnalyzerSmoothing")
QSpectrumAnalyzerSmoothing.resize(250, 130)
self.verticalLayout = QtWidgets.QVBoxLayout(QSpectrumAnalyzerSmoothing)
self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setObjectName("formLayout")
self.label = QtWidgets.QLabel(QSpectrumAnalyzerSmoothing)
self.label.setObjectName("label")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label)
self.windowFunctionComboBox = QtWidgets.QComboBox(QSpectrumAnalyzerSmoothing)
self.windowFunctionComboBox.setObjectName("windowFunctionComboBox")
self.windowFunctionComboBox.addItem("")
self.windowFunctionComboBox.addItem("")
self.windowFunctionComboBox.addItem("")
self.windowFunctionComboBox.addItem("")
self.windowFunctionComboBox.addItem("")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.windowFunctionComboBox)
self.label_2 = QtWidgets.QLabel(QSpectrumAnalyzerSmoothing)
self.label_2.setObjectName("label_2")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_2)
self.windowLengthSpinBox = QtWidgets.QSpinBox(QSpectrumAnalyzerSmoothing)
self.windowLengthSpinBox.setMinimum(3)
self.windowLengthSpinBox.setMaximum(1001)
self.windowLengthSpinBox.setProperty("value", 11)
self.windowLengthSpinBox.setObjectName("windowLengthSpinBox")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.windowLengthSpinBox)
self.verticalLayout.addLayout(self.formLayout)
spacerItem = QtWidgets.QSpacerItem(20, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.buttonBox = QtWidgets.QDialogButtonBox(QSpectrumAnalyzerSmoothing)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.label.setBuddy(self.windowFunctionComboBox)
self.label_2.setBuddy(self.windowLengthSpinBox)
self.retranslateUi(QSpectrumAnalyzerSmoothing)
self.windowFunctionComboBox.setCurrentIndex(1)
self.buttonBox.accepted.connect(QSpectrumAnalyzerSmoothing.accept)
self.buttonBox.rejected.connect(QSpectrumAnalyzerSmoothing.reject)
QtCore.QMetaObject.connectSlotsByName(QSpectrumAnalyzerSmoothing)
QSpectrumAnalyzerSmoothing.setTabOrder(self.windowFunctionComboBox, self.windowLengthSpinBox)
QSpectrumAnalyzerSmoothing.setTabOrder(self.windowLengthSpinBox, self.buttonBox)
示例9: setupUi
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(465, 393)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setContentsMargins(-1, 20, -1, 20)
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.icon_lb = QtWidgets.QLabel(Dialog)
font = QtWidgets.QFont()
font.setPointSize(20)
self.icon_lb.setFont(font)
self.icon_lb.setText("")
self.icon_lb.setObjectName("icon_lb")
self.horizontalLayout.addWidget(self.icon_lb)
self.title_lb = QtWidgets.QLabel(Dialog)
font = QtWidgets.QFont()
font.setPointSize(20)
self.title_lb.setFont(font)
self.title_lb.setObjectName("title_lb")
self.horizontalLayout.addWidget(self.title_lb)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.verticalLayout.addLayout(self.horizontalLayout)
self.text_link_lb = QtWidgets.QLabel(Dialog)
self.text_link_lb.setObjectName("text_link_lb")
self.verticalLayout.addWidget(self.text_link_lb)
self.textBrowser = QtWidgets.QTextBrowser(Dialog)
self.textBrowser.setObjectName("textBrowser")
self.verticalLayout.addWidget(self.textBrowser)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.donate_btn = QtWidgets.QPushButton(Dialog)
self.donate_btn.setObjectName("donate_btn")
self.horizontalLayout_2.addWidget(self.donate_btn)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.verticalLayout.setStretch(2, 1)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
示例10: __init__
# 需要導入模塊: from Qt import QtWidgets [as 別名]
# 或者: from Qt.QtWidgets import QSpacerItem [as 別名]
def __init__(self, parent=None, searchByHeaders=False):
super(PropertiesWidget, self).__init__(parent)
self.setWindowTitle("Properties view")
self.mainLayout = QtWidgets.QVBoxLayout(self)
self.mainLayout.setObjectName("propertiesMainLayout")
self.mainLayout.setContentsMargins(2, 2, 2, 2)
self.searchBox = QtWidgets.QLineEdit(self)
self.searchBox.setObjectName("lineEdit")
self.searchBox.setPlaceholderText(str("search..."))
self.searchBox.textChanged.connect(self.filterByHeaders if searchByHeaders else self.filterByHeadersAndFields)
self.searchBoxWidget = QtWidgets.QWidget()
self.searchBoxLayout = QtWidgets.QHBoxLayout(self.searchBoxWidget)
self.searchBoxLayout.setContentsMargins(1, 1, 1, 1)
self.searchBoxLayout.addWidget(self.searchBox)
# self.settingsButton = QtWidgets.QToolButton()
# self.settingsButton.setIcon(QtGui.QIcon(":/settings.png"))
# self.settingsMenu = QtWidgets.QMenu()
# self.editPropertiesAction = QtWidgets.QAction("Edit Parameter Interface", None)
# self.settingsMenu.addAction(self.editPropertiesAction)
# self.settingsButton.setMenu(self.settingsMenu)
# self.editPropertiesAction.triggered.connect(self.showPropertyEditor)
#self.settingsButton.clicked.connect(self.spawnDuplicate.emit)
# self.settingsButton.setPopupMode(QtWidgets.QToolButton.InstantPopup)
self.lockCheckBox = QtWidgets.QToolButton()
self.lockCheckBox.setCheckable(True)
self.lockCheckBox.setIcon(QtGui.QIcon(':/unlocked.png'))
self.lockCheckBox.toggled.connect(self.changeLockIcon)
self.searchBoxLayout.addWidget(self.lockCheckBox)
self.tearOffCopy = QtWidgets.QToolButton()
self.tearOffCopy.setIcon(QtGui.QIcon(":/tear_off_copy_bw.png"))
self.tearOffCopy.clicked.connect(self.spawnDuplicate.emit)
self.searchBoxLayout.addWidget(self.tearOffCopy)
self.mainLayout.addWidget(self.searchBoxWidget)
self.searchBoxWidget.hide()
self.contentLayout = QtWidgets.QVBoxLayout()
self.contentLayout.setSizeConstraint(QtWidgets.QLayout.SetMinAndMaxSize)
self.mainLayout.addLayout(self.contentLayout)
self.spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.mainLayout.addItem(self.spacerItem)
self.mainLayout.setSizeConstraint(QtWidgets.QLayout.SetMinAndMaxSize)
self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding))