Hi,
thanks for the reply.
I am not sure what do you mean.First off, see if having an actual pointer to your model makes a difference instead of allocating memory for it in the setModel method; i.e.:
QAbstractTableModelsubclass* myModel; //defined in header file as member of possibly QMainWindow
myModel = new QQAbstractTableModelsubclass(...);
pTable->setModel(myModel);
The call:
is not allocating anything.Qt Code:
To copy to clipboard, switch view to plain text mode
m_logFile->dataModel() returns a reference to a model which is allocated and lives in m_logFile.
At the time when I am calling pTable->setModel() the model is well allocated and filled with data, so I am not sure what you might have meant there, can you restate maybe?
Which setModel() do you mean? my model subclass setModel() or the pTable->setModel()?I'm not exactly sure what is happening when you make the call to setModel with your parameters (not seeing the whole code), but it looks suspicious.
And what exactly you find suspicious - so I can check it.
True.Also, another avenue is seeing your data function, which I don't see listed in your header. This is where the table view actually gets the data for your model.
I forgot to add it here, I will later when I am home again. (don't have the code here).
However, as I said, my data() function is not being called by the QTableView... all though I checked to make sure my virtual implementations signatures are correct, I will have a look again.
Thanks, and if you have more pointers, please share.
Bookmarks