本文整理匯總了Python中PyQt4.QtCore.Qt.AlignRight方法的典型用法代碼示例。如果您正苦於以下問題:Python Qt.AlignRight方法的具體用法?Python Qt.AlignRight怎麽用?Python Qt.AlignRight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.AlignRight方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: initUI
# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import AlignRight [as 別名]
def initUI(self):
font1 = QFont('Helvetica', large_text_size)
font2 = QFont('Helvetica', small_text_size)
self.vbox= QVBoxLayout()
self.time1 = ''
self.timeLbl = QLabel('')
self.timeLbl.setAlignment(Qt.AlignRight)
self.timeLbl.setFont(font1)
self.day_of_week1 = ''
self.dayOWLbl = QLabel('')
self.dayOWLbl.setAlignment(Qt.AlignRight)
self.date1 = ''
self.dateLbl = QLabel('')
self.dateLbl.setAlignment(Qt.AlignRight)
self.vbox.addWidget(self.timeLbl)
self.vbox.addWidget(self.dayOWLbl)
self.vbox.addWidget(self.dateLbl)
self.vbox.addStretch(2)
self.vbox.setSpacing(0)
self.setContentsMargins(0,0,0,0)
self.setLayout(self.vbox)
self.time_update()
示例2: alignRight
# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import AlignRight [as 別名]
def alignRight(self):
self.text.setAlignment(Qt.AlignRight)
示例3: data
# 需要導入模塊: from PyQt4.QtCore import Qt [as 別名]
# 或者: from PyQt4.QtCore.Qt import AlignRight [as 別名]
def data(self, modelIndex, role=None):
if not modelIndex.isValid():
return None
row = modelIndex.row()
col = modelIndex.column()
if role == Qt.DisplayRole:
if col in [PlayerModel.PLAYER, PlayerModel.PING, PlayerModel.OPPONENT]:
return self.players[row][col]
elif role == Qt.ToolTipRole and col in [PlayerModel.PLAYER, PlayerModel.OPPONENT]:
name = self.players[row][col]
if name in self.controller.players:
if self.controller.players[name].city:
return self.controller.players[name].country + ', ' + self.controller.players[name].city
else:
return self.controller.players[name].country
elif role == Qt.CheckStateRole and col == PlayerModel.IGNORE:
return self.players[row][col]
elif role == Qt.DecorationRole:
return self.dataIcon(row, col)
elif role == Qt.TextAlignmentRole:
if col == PlayerModel.PING:
return Qt.AlignRight | Qt.AlignVCenter
elif role == Qt.TextColorRole:
if col in [PlayerModel.PLAYER, PlayerModel.OPPONENT]:
name = self.players[row][col]
if name == 'ponder':
return QtGui.QBrush(QtGui.QColor(Qt.red))