code: def flags(self, index):
          
          # This method was implemented in CollectionsModel 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)
docs: Overriding method flags