Hi,
I'm getting more confused about custom models. I derive from QAbstractTableModel and thus implement the rowCount method. Now this returns obviously the amount of rows, but how do you dynamically change this?
Hi,
I'm getting more confused about custom models. I derive from QAbstractTableModel and thus implement the rowCount method. Now this returns obviously the amount of rows, but how do you dynamically change this?
Don't you have a member in your model that holds the current number of rows?
Sorry Marcel, I've worded this wrong.
I have a QList<> in the model class which holds the data for the table, I return the amount of items in this list to reflect the rowcount, but alas, the amount of rows in the table still doesn't change. I must be missing something, but don't know what?
Qt Code:
int DATreeModel::rowCount( const QModelIndex& parent ) const { return m_Data.count(); }To copy to clipboard, switch view to plain text mode
m_Data is the QList which gets appended to perodically.
Kind regards,
Steve
Do you inform the model interface and its environment through emitting signals upon inserting new items into the list?
Double thread: http://www.qtcentre.org/forum/f-newb...king-6960.html
Last edited by wysota; 11th May 2007 at 09:54.
Bookmarks