本文整理匯總了Python中PyQt5.QtWidgets.QSpacerItem方法的典型用法代碼示例。如果您正苦於以下問題:Python QtWidgets.QSpacerItem方法的具體用法?Python QtWidgets.QSpacerItem怎麽用?Python QtWidgets.QSpacerItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QSpacerItem方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
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)
示例2: initUi
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def initUi(self):
self.horizontalLayout = QHBoxLayout(self)
self.file_btn = QPushButton(QIcon(":/newPrefix/file.png"), self.text, self)
sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
self.file_btn.setSizePolicy(sizePolicy)
qss = '''QPushButton
{
background-color: transparent;
border: none;
}
QPushButton:hover {
background:transparent;
}'''
self.file_btn.setStyleSheet(qss)
self.bt_close = QToolButton(self)
self.bt_close.setIcon(QIcon(":/newPrefix/if_Delete_1493279.png"))
self.bt_close.setAutoRaise(True)
self.bt_close.setToolTip("Delete")
self.bt_close.clicked.connect(lambda: self.itemOpSignal.emit(self.listwidgetItem))
self.horizontalLayout.addWidget(self.bt_close)
self.horizontalLayout.addWidget(self.file_btn)
spacerItem = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
示例3: __init__
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def __init__(self, parent, buttons=False):
super(CollectionEditor, self).__init__(QWidget(parent))
self.preferences = None
self.propertyEditors = {}
self.setLayout(QVBoxLayout())
self.layout().setSpacing(0)
self.form = QFormLayout()
self.layout().addLayout(self.form)
self.stats = QVBoxLayout()
self.layout().addLayout(self.stats)
self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.layout().addItem(self.verticalSpacer)
self.buttons = buttons
if self.buttons:
self.addButtons()
示例4: setupUi
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, About):
About.setObjectName("About")
About.resize(498, 369)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(About.sizePolicy().hasHeightForWidth())
About.setSizePolicy(sizePolicy)
self.verticalLayout = QtWidgets.QVBoxLayout(About)
self.verticalLayout.setObjectName("verticalLayout")
self.gridLayout_11 = QtWidgets.QGridLayout()
self.gridLayout_11.setObjectName("gridLayout_11")
self.label_6 = QtWidgets.QLabel(About)
self.label_6.setObjectName("label_6")
self.gridLayout_11.addWidget(self.label_6, 1, 1, 1, 1)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_11.addItem(spacerItem, 1, 2, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_11.addItem(spacerItem1, 1, 0, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_11.addItem(spacerItem2, 0, 1, 1, 1)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_11.addItem(spacerItem3, 2, 1, 1, 1)
self.verticalLayout.addLayout(self.gridLayout_11)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem4)
self.button_close = QtWidgets.QPushButton(About)
self.button_close.setObjectName("button_close")
self.horizontalLayout.addWidget(self.button_close)
self.verticalLayout.addLayout(self.horizontalLayout)
self.retranslateUi(About)
QtCore.QMetaObject.connectSlotsByName(About)
示例5: setupUi
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
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)
示例6: setupUi
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
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)
示例7: setupUi
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, IDAngrAddMem):
IDAngrAddMem.setObjectName("IDAngrAddMem")
IDAngrAddMem.resize(440, 251)
self.gridLayout_2 = QtWidgets.QGridLayout(IDAngrAddMem)
self.gridLayout_2.setObjectName("gridLayout_2")
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(IDAngrAddMem)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.addrTextEdit = QtWidgets.QLineEdit(IDAngrAddMem)
self.addrTextEdit.setObjectName("addrTextEdit")
self.gridLayout.addWidget(self.addrTextEdit, 1, 0, 1, 1)
self.label_2 = QtWidgets.QLabel(IDAngrAddMem)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
self.lenTextEdit = QtWidgets.QLineEdit(IDAngrAddMem)
self.lenTextEdit.setObjectName("lenTextEdit")
self.gridLayout.addWidget(self.lenTextEdit, 3, 0, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
spacerItem = QtWidgets.QSpacerItem(20, 79, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem, 1, 0, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(IDAngrAddMem)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout_2.addWidget(self.buttonBox, 2, 0, 1, 1)
self.retranslateUi(IDAngrAddMem)
self.buttonBox.accepted.connect(IDAngrAddMem.accept)
self.buttonBox.rejected.connect(IDAngrAddMem.reject)
QtCore.QMetaObject.connectSlotsByName(IDAngrAddMem)
示例8: setupUi
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
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)
示例9: setupUi
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, MessageDlg):
MessageDlg.setObjectName("MessageDlg")
MessageDlg.resize(263, 96)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(15)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(MessageDlg.sizePolicy().hasHeightForWidth())
MessageDlg.setSizePolicy(sizePolicy)
self.verticalLayout_2 = QtWidgets.QVBoxLayout(MessageDlg)
self.verticalLayout_2.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
self.verticalLayout_2.setContentsMargins(6, 6, 6, 6)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.lblMessage = QtWidgets.QLabel(MessageDlg)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lblMessage.sizePolicy().hasHeightForWidth())
self.lblMessage.setSizePolicy(sizePolicy)
self.lblMessage.setSizeIncrement(QtCore.QSize(0, 0))
self.lblMessage.setFrameShape(QtWidgets.QFrame.Box)
self.lblMessage.setText("")
self.lblMessage.setScaledContents(True)
self.lblMessage.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.lblMessage.setWordWrap(True)
self.lblMessage.setOpenExternalLinks(True)
self.lblMessage.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
self.lblMessage.setObjectName("lblMessage")
self.verticalLayout_2.addWidget(self.lblMessage)
spacerItem = QtWidgets.QSpacerItem(20, 0, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem)
self.buttonBox = QtWidgets.QDialogButtonBox(MessageDlg)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout_2.addWidget(self.buttonBox)
self.retranslateUi(MessageDlg)
QtCore.QMetaObject.connectSlotsByName(MessageDlg)
示例10: setupUi
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def setupUi(self, DockWidget):
DockWidget.setObjectName("DockWidget")
DockWidget.resize(513, 387)
self.dockWidgetContents = QtWidgets.QWidget()
self.dockWidgetContents.setEnabled(True)
self.dockWidgetContents.setObjectName("dockWidgetContents")
self.gridLayout = QtWidgets.QGridLayout(self.dockWidgetContents)
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(self.dockWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Preferred,
QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
self.label.setAcceptDrops(True)
self.label.setAutoFillBackground(False)
self.label.setText("")
self.label.setPixmap(
QtGui.QPixmap(":/plugins/dzetsaka/img/parcguyane.jpg"))
self.label.setScaledContents(False)
self.label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
spacerItem = QtWidgets.QSpacerItem(
478, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.gridLayout.addItem(spacerItem, 1, 0, 1, 1)
self.label_2 = QtWidgets.QLabel(self.dockWidgetContents)
self.label_2.setAutoFillBackground(True)
self.label_2.setWordWrap(True)
self.label_2.setOpenExternalLinks(True)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
DockWidget.setWidget(self.dockWidgetContents)
self.retranslateUi(DockWidget)
QtCore.QMetaObject.connectSlotsByName(DockWidget)
示例11: add_framerate
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def add_framerate(self, framerate_acc):
lbl_name = QLabel(framerate_acc.name)
fr_disp = FramerateWidget(framerate_acc)
if len(self.fr_widgets) > 0:
self.layout().addItem(QSpacerItem(40, 10))
self.layout().addWidget(lbl_name)
self.fr_widgets.append(fr_disp)
self.layout().addWidget(fr_disp)
示例12: __init__
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def __init__(self, equipment=None, entradas=1, parent=None):
"""
equipment: Initial equipment instance to model
entradas: Stream Input number to equipment
"""
super().__init__(Mixer, salida=False, parent=parent)
# Input tab
for i in range(entradas):
entrada = UI_corriente.Ui_corriente()
entrada.Changed.connect(partial(self.cambiarEntrada, i))
self.Entrada.addTab(entrada, str(i+1))
# Calculate tab
lyt_Calc = QtWidgets.QGridLayout(self.tabCalculo)
lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
"pychemqt", "Output Pressure Method")), 1, 1)
self.criterio = QtWidgets.QComboBox()
for txt in self.Equipment.TEXT_METODO:
self.criterio.addItem(txt)
self.criterio.currentIndexChanged.connect(self.criterio_Changed)
lyt_Calc.addWidget(self.criterio, 1, 2)
lyt_Calc.addItem(QtWidgets.QSpacerItem(
20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
2, 1, 1, 3)
lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
"pychemqt", "Output Pressure")), 3, 1)
self.Pout = Entrada_con_unidades(Pressure)
self.Pout.valueChanged.connect(partial(self.changeParams, "Pout"))
lyt_Calc.addWidget(self.Pout, 3, 2)
lyt_Calc.addItem(QtWidgets.QSpacerItem(
20, 20, QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Expanding), 4, 1, 1, 3)
self.criterio_Changed(0)
if equipment:
self.setEquipment(equipment)
else:
self.Equipment = Mixer(entradas=entradas)
示例13: __init__
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def __init__(self, parent=None):
super(widgetReacciones, self).__init__(parent)
self.indices, self.nombres, M=getComponents()
gridLayout = QtWidgets.QGridLayout(self)
self.TablaReacciones=Tabla(5, horizontalHeader=[QtWidgets.QApplication.translate("pychemqt", "Reaction"), "ΔHr, %s" %unidades.MolarEnthalpy(None).text(), QtWidgets.QApplication.translate("pychemqt", "Type"), QtWidgets.QApplication.translate("pychemqt", "Phase"), QtWidgets.QApplication.translate("pychemqt", "Description")], dinamica=False, verticalHeader=True, orientacion=QtCore.Qt.AlignLeft)
self.TablaReacciones.setMinimumWidth(500)
self.TablaReacciones.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.TablaReacciones.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
self.TablaReacciones.horizontalHeader().setStretchLastSection(True)
self.TablaReacciones.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.TablaReacciones.itemSelectionChanged.connect(self.actualizarBotones)
gridLayout.addWidget(self.TablaReacciones,1,1,6,4)
self.botonAbrir=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/fileOpen.png")), QtWidgets.QApplication.translate("pychemqt", "Open"))
self.botonAbrir.clicked.connect(self.botonAbrirClicked)
gridLayout.addWidget(self.botonAbrir,1,5)
self.botonGuardar=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/fileSave.png")), QtWidgets.QApplication.translate("pychemqt", "Save"))
self.botonGuardar.clicked.connect(self.botonGuardarClicked)
self.botonGuardar.setSizePolicy(QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed)
self.botonGuardar.setEnabled(False)
gridLayout.addWidget(self.botonGuardar,2,5)
self.botonNew=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/fileNew.png")), QtWidgets.QApplication.translate("pychemqt", "New"))
self.botonNew.clicked.connect(self.botonNewClicked)
gridLayout.addWidget(self.botonNew,3,5)
self.botonEdit=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/editor.png")), QtWidgets.QApplication.translate("pychemqt", "Edit"))
self.botonEdit.setEnabled(False)
self.botonEdit.setCheckable(True)
self.botonEdit.clicked.connect(self.botonEditClicked)
gridLayout.addWidget(self.botonEdit,4,5)
self.botonDelete=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/editDelete.png")), QtWidgets.QApplication.translate("pychemqt", "Delete"))
self.botonDelete.setEnabled(False)
self.botonDelete.clicked.connect(self.botonDeleteClicked)
gridLayout.addWidget(self.botonDelete,5,5)
self.botonClear=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/clear.png")), QtWidgets.QApplication.translate("pychemqt", "Clear"))
self.botonClear.clicked.connect(self.botonClearClicked)
gridLayout.addWidget(self.botonClear,6,5)
gridLayout.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),10,1)
示例14: __init__
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def __init__(self, config=None, parent=None):
super(Widget, self).__init__(parent)
layout = QtWidgets.QGridLayout(self)
layout.addWidget(QtWidgets.QLabel(
QtWidgets.QApplication.translate("pychemqt", "Method:")), 1, 1)
self.metodos = QtWidgets.QComboBox()
for f in f_list:
line = f.__doc__.split("\n")[0]
year = line.split(" ")[-1]
name = line.split(" ")[-3]
doc = name + " " + year
self.metodos.addItem(doc)
layout.addWidget(self.metodos, 1, 2)
self.fanning = QtWidgets.QCheckBox(QtWidgets.QApplication.translate(
"pychemqt", "Calculate fanning friction factor"))
layout.addWidget(self.fanning, 2, 1, 1, 2)
layout.addWidget(QtWidgets.QLabel("ε/d:"), 3, 1)
self.ed = QtWidgets.QLineEdit()
layout.addWidget(self.ed, 3, 2)
self.lineconfig = LineConfig(
"line", QtWidgets.QApplication.translate(
"pychemqt", "Relative roughtness style line"))
layout.addWidget(self.lineconfig, 4, 1, 1, 2)
self.cruxconfig = LineConfig(
"crux", QtWidgets.QApplication.translate(
"pychemqt", "Crux style line"))
layout.addWidget(self.cruxconfig, 5, 1, 1, 2)
layout.addItem(QtWidgets.QSpacerItem(
10, 0, QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 3)
if config and config.has_section("Moody"):
self.metodos.setCurrentIndex(config.getint("Moody", 'method'))
self.fanning.setChecked(config.getboolean("Moody", 'fanning'))
self.ed.setText(config.get("Moody", "ed"))
self.lineconfig.setConfig(config, "Moody")
self.cruxconfig.setConfig(config, "Moody")
示例15: __init__
# 需要導入模塊: from PyQt5 import QtWidgets [as 別名]
# 或者: from PyQt5.QtWidgets import QSpacerItem [as 別名]
def __init__(self, color="#ffffff", alpha=255, isAlpha=False, parent=None):
super(ColorSelector, self).__init__(parent)
lyt = QtWidgets.QHBoxLayout(self)
lyt.setContentsMargins(0, 0, 0, 0)
lyt.setSpacing(0)
self.RGB = QtWidgets.QLineEdit()
self.RGB.editingFinished.connect(self.rgbChanged)
self.RGB.setFixedSize(80, 24)
lyt.addWidget(self.RGB)
self.button = QtWidgets.QToolButton()
self.button.setFixedSize(24, 24)
self.button.clicked.connect(self.ColorButtonClicked)
lyt.addWidget(self.button)
lyt.addItem(QtWidgets.QSpacerItem(
20, 20, QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Fixed))
if isAlpha:
self.isAlpha = QtGui.QColor.HexArgb
else:
self.isAlpha = QtGui.QColor.HexRgb
r = int(color[1:3], 16)
g = int(color[3:5], 16)
b = int(color[5:7], 16)
color = QtGui.QColor(r, g, b, alpha)
self.setColor(color)