本文整理汇总了Python中PyQt4.QtCore.QAbstractTableModel.flags方法的典型用法代码示例。如果您正苦于以下问题:Python QAbstractTableModel.flags方法的具体用法?Python QAbstractTableModel.flags怎么用?Python QAbstractTableModel.flags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QAbstractTableModel
的用法示例。
在下文中一共展示了QAbstractTableModel.flags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
if not index.isValid():
return Qt.ItemIsEnabled
if self.isColumn("round", index) or self.isColumn("adjRating", index):
return Qt.ItemFlags(QAbstractTableModel.flags(self, index))
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) |
Qt.ItemIsEditable)
示例2: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
if not index.isValid():
return Qt.ItemIsEnabled
column = index.column()
if column in (MOD1, MOD2, MOD3, KEY):
return Qt.ItemFlags(QAbstractTableModel.flags(self, index)|
Qt.ItemIsEditable)
else:
return Qt.ItemFlags(QAbstractTableModel.flags(self, index))
示例3: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
"""
Returns the flags for the given index.
"""
# XXX varies if editable
if not index.isValid():
return Qt.ItemIsEnabled
elif self.is_first_commit(index):
# The first commit can't be dragged and dropped
return QAbstractTableModel.flags(self, index)
return Qt.ItemFlags(QAbstractTableModel.flags(self, index)|
Qt.ItemIsDragEnabled)
示例4: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
"""
This function is mandatory for model to work with editing data.
"""
if not index.isValid() or index.column() != NAME:
return Qt.ItemIsEnabled
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
示例5: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags( self, index ):
if not index.isValid():
return Qt.ItemIsEnabled
if index.column() == CANTIDAD:
return Qt.ItemFlags( QAbstractTableModel.flags( self, index ) | Qt.ItemIsEditable )
else:
return Qt.ItemIsEnabled
示例6: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
if not index.isValid():
return Qt.ItemIsEnabled
base = QAbstractTableModel.flags(self, index)
if index.column() == 1:
return base | Qt.ItemIsEditable
return base
示例7: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
"""Overriding method flags"""
# This method was implemented in DictModel only, but to enable tuple
# exploration (even without editing), this method was moved here
if not index.isValid():
return Qt.ItemIsEnabled
return Qt.ItemFlags(QAbstractTableModel.flags(self, index)|
Qt.ItemIsEditable)
示例8: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags( self, index ):
"""
Las flags de las celdas de este modelo, es editable para todas menos para TOTALC y TOTALD
"""
if not index.isValid():
return Qt.ItemIsEnabled
if index.column() in ( TOTALC, TOTALD ):
return Qt.ItemIsSelectable | Qt.ItemIsEnabled
return Qt.ItemFlags( QAbstractTableModel.flags( self, index ) | Qt.ItemIsEditable )
示例9: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
'''
@type index: QModelIndex
@rtype: Qt.ItemFlags
'''
flags = QAbstractTableModel.flags(self, index)
if index.column() == 1:
flags = flags | Qt.ItemIsUserCheckable
return flags
示例10: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
#print "flags:",
if not index.isValid():
return Qt.ItemIsEnabled
row, col = index.row(), index.column()
elem, fld = self._data[row][:2]
if col == C_VAL_SP and fld is not None:
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) |
Qt.ItemIsSelectable)
#return Qt.ItemFlags(QAbstractTableModel.flags(self, index) |
# Qt.ItemIsEditable)
return Qt.ItemIsEnabled
示例11: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
"""
Returns the flags for the given index.
"""
if not index.isValid():
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) |
Qt.ItemIsDropEnabled |
Qt.NoItemFlags)
column = index.column()
field_name = self.git_model.get_columns()[column]
# Neither first commits nor deleted commits can be edited.
if field_name not in NOT_EDITABLE_FIELDS and \
not self.is_first_commit(index) and\
not self.is_deleted(index):
return Qt.ItemFlags(QGitModel.flags(self, index) |
Qt.ItemIsEditable)
return QGitModel.flags(self, index)
示例12: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
if not index.isValid():
return Qt.ItemIsEnabled
return Qt.ItemFlags(
QAbstractTableModel.flags(self, index)|
Qt.ItemIsEditable)
示例13: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags (self, modelIndex):
ans= QAbstractTableModel.flags (self, modelIndex)
if modelIndex.column ()<7: # length or filepath are not editable
ans= ans|Qt.ItemIsEditable|Qt.ItemIsEditable
return ans
示例14: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
flags = QAbstractTableModel.flags(self, index)
if index.column() == 2:
flags |= Qt.ItemIsEditable
return flags
示例15: flags
# 需要导入模块: from PyQt4.QtCore import QAbstractTableModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractTableModel import flags [as 别名]
def flags(self, index):
if index.isValid():
return Qt.ItemIsEditable | QAbstractTableModel.flags(self, index)
return QAbstractTableModel.flags(self, index)