當前位置: 首頁>>代碼示例>>Python>>正文


Python QAbstractTableModel.flags方法代碼示例

本文整理匯總了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)
開發者ID:nleehone,項目名稱:qt_lmfit_table,代碼行數:11,代碼來源:qt_lmfit_table_model.py

示例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))
開發者ID:Bioeden,項目名稱:dbMayaTextureToolkit,代碼行數:15,代碼來源:mttModel.py

示例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
開發者ID:byteman1,項目名稱:BioPARKIN,代碼行數:9,代碼來源:sbml_entitytablemodel.py

示例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
開發者ID:byteman1,項目名稱:BioPARKIN,代碼行數:9,代碼來源:sbml_entitytablemodel.py

示例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
開發者ID:moritzwade,項目名稱:BioPARKIN,代碼行數:9,代碼來源:sbml_entitytablemodel.py

示例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)
開發者ID:vVvSHADOWvVv,項目名稱:sAB,代碼行數:10,代碼來源:tablemodel.py

示例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)
開發者ID:brunocanella,項目名稱:zoxel,代碼行數:19,代碼來源:dock_grid_manager.py

示例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)
開發者ID:pymontecarlo,項目名稱:pymontecarlo-gui,代碼行數:8,代碼來源:limit.py


注:本文中的PySide.QtCore.QAbstractTableModel.flags方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。