當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。