本文整理汇总了Python中PyQt4.Qt.QGridLayout.setHorizontalSpacing方法的典型用法代码示例。如果您正苦于以下问题:Python QGridLayout.setHorizontalSpacing方法的具体用法?Python QGridLayout.setHorizontalSpacing怎么用?Python QGridLayout.setHorizontalSpacing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QGridLayout
的用法示例。
在下文中一共展示了QGridLayout.setHorizontalSpacing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Footer
# 需要导入模块: from PyQt4.Qt import QGridLayout [as 别名]
# 或者: from PyQt4.Qt.QGridLayout import setHorizontalSpacing [as 别名]
class Footer(QWidget):
def __init__(self):
QWidget.__init__(self)
self.__InitUi()
def __InitUi(self):
self.setFixedHeight(160)
SetWidgetBackgroundColor(COLOR_WIDGET_2, self)
self.__Layout = QGridLayout()
self.setLayout(self.__Layout)
self.__Layout.setContentsMargins(30,30,30,30)
self.__Layout.setHorizontalSpacing(30)
self.__Layout.setVerticalSpacing(30)
self.__lblProcess = LabelSmalSize("", COLOR_FONT_4, True)
self.__Layout.addWidget(self.__lblProcess)
self.__pgbProgress = Progressbar()
self.__Layout.addWidget(self.__pgbProgress)
def ProcessStartet(self, strProcess):
self.__lblProcess.setText(strProcess)
self.__pgbProgress.setMaximum(0)
def ProcessEnded(self):
self.__lblProcess.setText("")
self.__pgbProgress.setMaximum(100)
示例2: MainView
# 需要导入模块: from PyQt4.Qt import QGridLayout [as 别名]
# 或者: from PyQt4.Qt.QGridLayout import setHorizontalSpacing [as 别名]
#.........这里部分代码省略.........
self.reactiveEnergyLabel = QLabel("0.00")
self.reactiveEnergyLabel.setFont(self.lcdNumbersFont)
self.reactiveEnergyString = QLabel("VARh")
self.reactiveEnergyString.setFont(self.lcdStringFont)
self.activePowerLabel = QLabel("0.00")
self.activePowerLabel.setFont(self.lcdNumbersFont)
self.activePowerString = QLabel("W")
self.activePowerString.setFont(self.lcdStringFont)
self.apparentPowerLabel = QLabel("0.00")
self.apparentPowerLabel.setFont(self.lcdNumbersFont)
self.apparentPowerString = QLabel("VA")
self.apparentPowerString.setFont(self.lcdStringFont)
self.reactivePowerLabel = QLabel("0.00")
self.reactivePowerLabel.setFont(self.lcdNumbersFont)
self.reactivePowerString = QLabel("VAR")
self.reactivePowerString.setFont(self.lcdStringFont)
# Horizontal lines
hline1 = self.HLine()
hline2 = self.HLine()
hline3 = self.HLine()
hline4 = self.HLine()
# Vertical lines
vline1 = self.VLine()
vline2 = self.VLine()
vline3 = self.VLine()
# Central grid layout for central widget
self.centralGridLayout = QGridLayout(self.centralWidget())
self.centralGridLayout.setHorizontalSpacing(20)
self.centralGridLayout.setVerticalSpacing(5)
# Add labels
self.centralGridLayout.addWidget(dataLabel,0,0,1,2, QtCore.Qt.AlignCenter)
self.centralGridLayout.addWidget(energyLabel,0,3,1,2, QtCore.Qt.AlignCenter)
self.centralGridLayout.addWidget(powerLabel,0,6,1,2, QtCore.Qt.AlignCenter)
self.centralGridLayout.addWidget(hline1, 1, 0, 1, -1)
self.centralGridLayout.addWidget(self.voltageLabel, 2, 0, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(self.voltageString, 2, 1, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(hline2, 3, 0, 1, -1)
self.centralGridLayout.addWidget(self.currentLabel, 4, 0, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(self.currentString, 4, 1, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(hline3, 5, 0, 1, -1)
self.centralGridLayout.addWidget(self.frequencyLabel, 6, 0, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(self.frequencyString, 6, 1, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(hline4, 7, 0, 1, -1)
self.centralGridLayout.addWidget(vline1, 0, 2, -1, 1)
self.centralGridLayout.addWidget(self.activeEnergyLabel, 2, 3, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(self.activeEnergyString, 2, 4, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(self.apparentEnergyLabel, 4, 3, 1, 1, QtCore.Qt.AlignLeft)
self.centralGridLayout.addWidget(self.apparentEnergyString, 4, 4, 1, 1, QtCore.Qt.AlignLeft)