mechsin
29th August 2012, 21:06
I have an excel like spread sheet that I am showing some test date in and I am using a QTableView in conjunction with a model. The user is allowed to both hide and move columns of the data. I want to be able to load data from a file. Everything works fine except the TableView seems to be holding onto which columns were hidden even after the model is reset.
My model has a changeDataSet function that is like this
def changeDataSet(self, dataset)
self.beginResetModel()
self.dataset = dataset
self.endResetModel()
This works fine the right number of columns and rows show up. All the data is in the right spot but the hidden columns seem to persist. Is there any way to reset the QTableView or do I need to go through and unhide all the hidden columns before I invalidate the model. If you couldn't tell from the Code block I am using PyQt and my data is coming from a Pickle file which is how I have a entire dataset class to just plug back in.
My model has a changeDataSet function that is like this
def changeDataSet(self, dataset)
self.beginResetModel()
self.dataset = dataset
self.endResetModel()
This works fine the right number of columns and rows show up. All the data is in the right spot but the hidden columns seem to persist. Is there any way to reset the QTableView or do I need to go through and unhide all the hidden columns before I invalidate the model. If you couldn't tell from the Code block I am using PyQt and my data is coming from a Pickle file which is how I have a entire dataset class to just plug back in.