本文整理汇总了Python中PyQt4.QtCore.QAbstractItemModel.flags方法的典型用法代码示例。如果您正苦于以下问题:Python QAbstractItemModel.flags方法的具体用法?Python QAbstractItemModel.flags怎么用?Python QAbstractItemModel.flags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QAbstractItemModel
的用法示例。
在下文中一共展示了QAbstractItemModel.flags方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import flags [as 别名]
def flags(self, index ):
"""See QAbstractItemModel docs
"""
flags = QAbstractItemModel.flags( self, index )
if self._replaceMode:
flags |= Qt.ItemIsUserCheckable
return flags
示例2: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import flags [as 别名]
def flags(self, index):
defaultFlags = QAbstractItemModel.flags(self, index)
if index.isValid():
if index.column() == 0:
return Qt.ItemIsDragEnabled | Qt.ItemIsDropEnabled | Qt.ItemIsEditable | defaultFlags
else:
return Qt.ItemIsDragEnabled | defaultFlags
else:
return Qt.ItemIsDropEnabled | defaultFlags
示例3: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import flags [as 别名]
def flags(self, index):
"""QAbstractItemModel required"""
theFlags = QAbstractItemModel.flags(self,index)
if index.isValid():
theFlags |= Qt.ItemIsSelectable | Qt.ItemIsEnabled
if index.column() == NAME:
theFlags |= Qt.ItemIsEditable | Qt.ItemIsDragEnabled | Qt.ItemIsDropEnabled
# end if
return theFlags
示例4: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import flags [as 别名]
def flags(self, index):
defaultFlags = QAbstractItemModel.flags(self, index)
if index.isValid():
return Qt.ItemIsDragEnabled | defaultFlags
else:
return defaultFlags
示例5: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import flags [as 别名]
def flags(self, index):
flags = QAbstractItemModel.flags(self, index) ^ QtCore.Qt.ItemIsSelectable
return flags
示例6: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import flags [as 别名]
def flags(self, index):
if not index.isValid():
return QAbstractItemModel.flags(self, index) | Qt.ItemIsEnabled
return self._flags | Qt.ItemIsEnabled