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


Python Qt.AlignRight方法代码示例

本文整理汇总了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() 
开发者ID:aishmittal,项目名称:Smart-Mirror,代码行数:25,代码来源:smartmirror-bing.py

示例2: alignRight

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

示例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)) 
开发者ID:doctorguile,项目名称:pyqtggpo,代码行数:31,代码来源:playermodel.py


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