本文整理汇总了Python中PyQt4.QtCore.QAbstractItemModel.headerData方法的典型用法代码示例。如果您正苦于以下问题:Python QAbstractItemModel.headerData方法的具体用法?Python QAbstractItemModel.headerData怎么用?Python QAbstractItemModel.headerData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QAbstractItemModel
的用法示例。
在下文中一共展示了QAbstractItemModel.headerData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: headerData
# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import headerData [as 别名]
def headerData(self, section, orientation, role):
if orientation == Qt.Horizontal:
if role == Qt.DisplayRole or role == Qt.ToolTipRole :
if section == ActionModel.Action:
return tr( "Action" )
elif section == ActionModel.Shortcut:
return tr( "Shortcut" )
elif section == ActionModel.DefaultShortcut:
return tr( "Default Shortcut" )
return QAbstractItemModel.headerData(self, section, orientation, role )
示例2: headerData
# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import headerData [as 别名]
def headerData(self, section, orientation, role=Qt.DisplayRole):
if section >= 0 and section < 4 and orientation == Qt.Horizontal:
if role == Qt.DisplayRole:
return self.__headers[section]
return QAbstractItemModel.headerData(self, section, orientation, role)