当前位置: 首页>>代码示例>>Python>>正文


Python QGridLayout.setHorizontalSpacing方法代码示例

本文整理汇总了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)
开发者ID:gebenedeit,项目名称:sccpy,代码行数:28,代码来源:Footer.py

示例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)
        
开发者ID:borislav-,项目名称:power_meter,代码行数:69,代码来源:ac_meter_gui.py


注:本文中的PyQt4.Qt.QGridLayout.setHorizontalSpacing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。