當前位置: 首頁>>代碼示例>>Python>>正文


Python QAbstractTableModel.headerData方法代碼示例

本文整理匯總了Python中PyQt5.QtCore.QAbstractTableModel.headerData方法的典型用法代碼示例。如果您正苦於以下問題:Python QAbstractTableModel.headerData方法的具體用法?Python QAbstractTableModel.headerData怎麽用?Python QAbstractTableModel.headerData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtCore.QAbstractTableModel的用法示例。


在下文中一共展示了QAbstractTableModel.headerData方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: headerData

# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import headerData [as 別名]
 def headerData(self, section, orientation, role = Qt.DisplayRole):
     if role == Qt.DisplayRole:
         if orientation == Qt.Horizontal:
             return str(self.h_header[section])
         elif orientation == Qt.Vertical:
             return str(self.v_header[section])
     return QAbstractTableModel.headerData(self, section, orientation, role)
開發者ID:Acbarakat,項目名稱:MtGCubeViz,代碼行數:9,代碼來源:models.py

示例2: headerData

# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import headerData [as 別名]
 def headerData(self, section, orientation, role):
     """
     Public method to get header data from the model.
     
     @param section section number (integer)
     @param orientation orientation (Qt.Orientation)
     @param role role of the data to retrieve (integer)
     @return requested data
     """
     if role == Qt.SizeHintRole:
         fm = QFontMetrics(QFont())
         height = fm.height() + fm.height() // 3
         width = \
             fm.width(self.headerData(section, orientation, Qt.DisplayRole))
         return QSize(width, height)
     
     if orientation == Qt.Horizontal:
         if role == Qt.DisplayRole:
             try:
                 return self.__headers[section]
             except IndexError:
                 return None
         
         return None
     
     return QAbstractTableModel.headerData(self, section, orientation, role)
開發者ID:Darriall,項目名稱:eric,代碼行數:28,代碼來源:CookieModel.py

示例3: headerData

# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import headerData [as 別名]
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     """
     Public method to get header data from the model.
     
     @param section section number (integer)
     @param orientation orientation (Qt.Orientation)
     @param role role of the data to retrieve (integer)
     @return requested data
     """
     if orientation == Qt.Horizontal and role == Qt.DisplayRole:
         return self.__headerData[section]
     
     return QAbstractTableModel.headerData(self, section, orientation, role)
開發者ID:Darriall,項目名稱:eric,代碼行數:15,代碼來源:E5NetworkMonitor.py

示例4: headerData

# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import headerData [as 別名]
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     """
     Public method to get the header data.
     
     @param section section number (integer)
     @param orientation header orientation (Qt.Orientation)
     @param role data role (integer)
     @return header data
     """
     if orientation == Qt.Horizontal and role == Qt.DisplayRole:
         try:
             return self.__headers[section]
         except IndexError:
             pass
     return QAbstractTableModel.headerData(self, section, orientation, role)
開發者ID:pycom,項目名稱:EricShort,代碼行數:17,代碼來源:HistoryModel.py

示例5: headerData

# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import headerData [as 別名]
 def headerData(self, section, orientation, role=Qt.DisplayRole):
     if orientation == Qt.Horizontal and role==Qt.DisplayRole:
         return self.infoKeys[section]
     return QAbstractTableModel.headerData(self, section, orientation, role)
開發者ID:petrushev,項目名稱:txplaya,代碼行數:6,代碼來源:playlist.py

示例6: headerData

# 需要導入模塊: from PyQt5.QtCore import QAbstractTableModel [as 別名]
# 或者: from PyQt5.QtCore.QAbstractTableModel import headerData [as 別名]
 def headerData( self, section, orientation, role=QtCore.Qt.DisplayRole ):
     if role == QtCore.Qt.DisplayRole and orientation == QtCore.Qt.Horizontal:
         return self.COLUMNS[section]
     return QAbstractTableModel.headerData( self, section, orientation, role )
開發者ID:jtotto,項目名稱:sooper-jack-midi-looper,代碼行數:6,代碼來源:models.py


注:本文中的PyQt5.QtCore.QAbstractTableModel.headerData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。