Hi,
I use boost::circular_buffer as underly data stru in my own model,
I set capacity of circular_buffer in advance. For example , 30000. If I push_back more than 30000 data. the first ones will be deleted.
The question is: What signal should I emit to notice the QTableView to act correctly?
I tyr emit layoutabouttobechanged() layoutChanged(), but the selection stateis not act properly with the data push_back!
Another test is
endRemoveRows();
beginInsertRows
(QModelIndex(),max_alarm_num
-alarms.
size(),max_alarm_num
-1);
endInsertRows();
beginRemoveRows(QModelIndex(),0,alarms.size()-1);
endRemoveRows();
beginInsertRows(QModelIndex(),max_alarm_num-alarms.size(),max_alarm_num-1);
endInsertRows();
To copy to clipboard, switch view to plain text mode
It seems work, but I doubt it as in the Qt Assistant
When reimplementing insertRows() in a subclass, you must call this function
before inserting data into the model's underlying data store.
Bookmarks