本文整理汇总了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))