krystosan 0 Junior Poster

I am trying to remove a column from PyQt4 implementation of table model ,

however I am not able to figure it out what I am doing wrong

    def removeColumns(self, position, columns, parent = QtCore.QModelIndex()):
        self.beginRemoveColumns(parent, position, position + columns - 1)
        #Do removing here
        rowCount = len(self.__colors)
        for i in reversed(range(position, columns)):
            for j in reversed(range(len(self.__colors[0]))):
                print i, j
                value = self.__colors[i][j]
                self.__colors.remove(value)
        self.endRemoveColumns()
        return True

any help would be appreciated...