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


Python Qt.AlignLeft方法代码示例

本文整理汇总了Python中PyQt4.QtCore.Qt.AlignLeft方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.AlignLeft方法的具体用法?Python Qt.AlignLeft怎么用?Python Qt.AlignLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtCore.Qt的用法示例。


在下文中一共展示了Qt.AlignLeft方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initUI

# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignLeft [as 别名]
def initUI(self):
        
        self.heading = QLabel('Stocks Today')
        self.heading.setAlignment(Qt.AlignLeft)
        self.heading.setFont(font2)
        
        self.vbox = QVBoxLayout()
        self.vbox.addWidget(self.heading)
        self.vbox.setAlignment(Qt.AlignTop)

        self.fbox = QFormLayout()
        self.fbox.setSpacing(10)
        self.fbox.setAlignment(Qt.AlignLeft)
        
        self.stockLbl = QLabel('Stocks')
        self.priceLbl = QLabel('Current Price (Rs.)')
        self.stockLbl.setFont(font1)
        self.priceLbl.setFont(font1)
        
        self.fbox.addRow(self.stockLbl,self.priceLbl)
        self.stockNames = ['SENSEX','NIFTY', 'RELIANCE','ITC','TCS']
        
        self.update_check()        
        self.vbox.addLayout(self.fbox)
        self.setLayout(self.vbox) 
开发者ID:aishmittal,项目名称:Smart-Mirror,代码行数:27,代码来源:smartmirror-bing.py

示例2: initUI

# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignLeft [as 别名]
def initUI(self):
        
        self.vbox = QVBoxLayout()
        self.heading = QLabel()
        
        self.size= "480x360"

        
        #self.source="the-times-of-india"
        self.fbox = QFormLayout()
        self.fbox.setAlignment(Qt.AlignLeft)
        self.fbox.setSpacing(8)

        self.heading.setAlignment(Qt.AlignCenter)
        self.heading.setFont(font2)
        
        self.vbox.addWidget(self.heading)
        self.vbox.addLayout(self.fbox)
        
        self.setLayout(self.vbox)
        self.news_fetcher()
        #self.addWidget(News)
        

    #updating news 
开发者ID:aishmittal,项目名称:Smart-Mirror,代码行数:27,代码来源:smartmirror.py

示例3: alignLeft

# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignLeft [as 别名]
def alignLeft(self):
        self.text.setAlignment(Qt.AlignLeft) 
开发者ID:goldsborough,项目名称:Writer,代码行数:4,代码来源:writer.py

示例4: addLoadingMsg

# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignLeft [as 别名]
def addLoadingMsg(self, countLayers, barText='Downloading datasets'):
        barText = self.tr(barText)
        progressMessageBar = self.iface.messageBar().createMessage(barText, '0/' + str(countLayers))
        progress = QProgressBar()
        progress.setMaximum(countLayers)
        progress.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
        progressMessageBar.layout().addWidget(progress)
        return progressMessageBar, progress 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:10,代码来源:CartoDBPlugin.py

示例5: drawStats

# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignLeft [as 别名]
def drawStats(self, qp):
        defaultCol = QColor(0,255,0, 200)

        #qp = QtGui.QPainter()
        qp.resetTransform()
        w = self.width()
        h = self.height()

        top = 50
        bottom = h-50
        width, height = w*0.2, 22
        dist = 10
        space = height+dist
        pos = width/4


        # DRAW PROGRESS BAGS (left)
        if self.bat>-1:
            self.drawBar(qp, QRectF(pos, top+space*0, width,height), defaultCol, 'BAT %4.2fV'%(self.bat/1000.), self.bat, 3000, 4150)
        if self.link>-1:
            self.drawBar(qp, QRectF(pos, top+space*1, width,height), defaultCol, 'SIG %03d%%'%self.link, self.link)
        if self.cpu>-1:
            self.drawBar(qp, QRectF(pos, top+space*2, width,height), defaultCol, 'CPU %03d%%'%self.cpu, self.cpu)



        # DRAW RAW STATS( right)
        pos = w-width/4-width/2
        space = height+2

        if self.pktsOut>-1:
            qp.drawText(QRectF(pos, top+space*0, width,height), Qt.AlignLeft, '%04d kb/s'%self.pktsOut)
        if self.pktsIn>-1:
            qp.drawText(QRectF(pos, top+space*1, width,height), Qt.AlignLeft, '%04d kb/s'%self.pktsIn)

        if self.pressure>-1:
            qp.drawText(QRectF(pos, top+space*3, width,height), Qt.AlignLeft, '%06.2f hPa'%self.pressure)
        if self.temp>-1:
            qp.drawText(QRectF(pos, top+space*4, width,height), Qt.AlignLeft, QString('%05.2f'%self.temp)+QChar(0260)+QString("C"))
        if self.aslLong>-1:
            qp.drawText(QRectF(pos, top+space*5, width,height), Qt.AlignLeft, '%4.2f m'%self.aslLong) 
开发者ID:omwdunkley,项目名称:crazyflieROS,代码行数:43,代码来源:ai.py


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