本文整理汇总了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)
示例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
示例3: alignLeft
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import AlignLeft [as 别名]
def alignLeft(self):
self.text.setAlignment(Qt.AlignLeft)
示例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
示例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)