本文整理匯總了Python中PySide.QtCore.QAbstractTableModel.flags方法的典型用法代碼示例。如果您正苦於以下問題:Python QAbstractTableModel.flags方法的具體用法?Python QAbstractTableModel.flags怎麽用?Python QAbstractTableModel.flags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PySide.QtCore.QAbstractTableModel
的用法示例。
在下文中一共展示了QAbstractTableModel.flags方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: flags
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import flags [as 別名]
def flags(self, index):
if not index.isValid():
return Qt.ItemIsEnabled
# If the column is the vary parameter then we want the user to be able to check/uncheck the box
if index.column() == 1:
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable)
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
示例2: flags
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import flags [as 別名]
def flags(self, index):
""" Define editable cells
:param index:
"""
if not index.isValid():
return Qt.ItemIsEnabled
if index.column() in [NODE_NAME, NODE_FILE]:
return Qt.ItemFlags(
QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
return Qt.ItemFlags(QAbstractTableModel.flags(self, index))
示例3: flagsEvent
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import flags [as 別名]
def flagsEvent(self, index):
row = index.row()
if (index.column() == COLUMN.VALUE and
(row == EVENT_ROW.NAME or row == EVENT_ROW.TARGET or row == EVENT_ROW.EXPRESSION or row == EVENT_ROW.TRIGGEREXPRESSION)):
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
else:
return None
示例4: flagsRule
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import flags [as 別名]
def flagsRule(self, index):
row = index.row()
if (index.column() == COLUMN.VALUE and
(row == RULE_ROW.NAME or row == RULE_ROW.VARIABLE or row == RULE_ROW.MATH)):
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
else:
return None
示例5: flagsGeneral
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import flags [as 別名]
def flagsGeneral(self, index):
row = index.row()
if index.column() == COLUMN.VALUE and row == 1: # 1 is hardcoded; "Name" always has to be at 2nd position
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
else:
#return Qt.ItemFlags(QAbstractTableModel.flags(self, index))
return None
示例6: flags
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import flags [as 別名]
def flags(self, index):
""" Set the item flags at the given index. Seems like we're
implementing this function just to see how it's done, as we
manually adjust each tableView to have NoEditTriggers.
"""
if not index.isValid():
return Qt.ItemIsEnabled
return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
示例7: flags
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.QtCore.QAbstractTableModel import flags [as 別名]
def flags(self,index):
if ( not index.isValid() ):
return super(VoxelGridModel,self).flags(index)
# creating some shortcuts for the GridPlane and the Column
grid_plane = self._data[index.row()]
column = GridManagerColumns.Columns[index.column()]
# The default planes cannot have some of its values changed (Name, Plane, Offset), so we protect them here.
if( grid_plane.name in VoxelGrid.ReservedNames.values() ):
if( column in [ GridManagerColumns.Visible, GridManagerColumns.Collision ] ):
return super(VoxelGridModel,self).flags(index) | Qt.ItemIsEditable
else:
return super(VoxelGridModel,self).flags(index)
# If it's not one of the protected planes, the everything is valid >.< (user can edit)
if( column != GridManagerColumns.Color ):
return super(VoxelGridModel,self).flags(index) | Qt.ItemIsEditable
return QAbstractTableModel.flags(self,index)
示例8: flags
# 需要導入模塊: from PySide.QtCore import QAbstractTableModel [as 別名]
# 或者: from PySide.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)