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)
    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))
Beispiel #3
0
    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))
 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
 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
 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
Beispiel #7
0
 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)
Beispiel #8
0
 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)
Beispiel #9
0
 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
Beispiel #10
0
    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)
Beispiel #11
0
        def flags(self, index):
            if not index.isValid():
                return Qt.ItemIsEnabled

            return Qt.ItemFlags(QAbstractTableModel.flags(self, index) |
                                Qt.ItemIsEditable)
 def flags(self, index):
     if not index.isValid():
         return Qt.ItemIsEnabled
     return Qt.ItemFlags(
         QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)