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