当前位置: 首页>>代码示例>>Python>>正文


Python QAbstractTableModel.flags方法代码示例

本文整理汇总了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)
开发者ID:Whatang,项目名称:QBetty,代码行数:9,代码来源:RaceModel.py

示例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))
开发者ID:koll00,项目名称:Gui_SM,代码行数:11,代码来源:shortcuts.py

示例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)
开发者ID:mike-perdide,项目名称:gitbuster,代码行数:15,代码来源:q_git_model.py

示例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)
开发者ID:grucha,项目名称:Sniffer,代码行数:9,代码来源:nodes.py

示例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
开发者ID:armonge,项目名称:EsquipulasPy,代码行数:9,代码来源:devolucionmodel.py

示例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
开发者ID:PierreBdR,项目名称:point_tracker,代码行数:10,代码来源:timemodel.py

示例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)
开发者ID:cheesinglee,项目名称:spyder,代码行数:10,代码来源:dicteditor.py

示例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 )
开发者ID:armonge,项目名称:EsquipulasPy,代码行数:11,代码来源:entradacompramodel.py

示例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
开发者ID:aleximplode,项目名称:Show-Tracker,代码行数:13,代码来源:dataclasses.py

示例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
开发者ID:ChannelFinder,项目名称:hla,代码行数:15,代码来源:elemeditor.py

示例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)
开发者ID:mike-perdide,项目名称:gitbuster,代码行数:22,代码来源:q_editable_git_model.py

示例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)  
开发者ID:Artemis1997,项目名称:trading-with-python,代码行数:8,代码来源:qtpandas.py

示例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
开发者ID:StyXman,项目名称:satyr,代码行数:8,代码来源:complex.py

示例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
开发者ID:Pesa,项目名称:forse,代码行数:7,代码来源:WeatherModel.py

示例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)
开发者ID:OSUser,项目名称:quickpanel,代码行数:6,代码来源:todo_list.py


注:本文中的PyQt4.QtCore.QAbstractTableModel.flags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。