BINGO!!!!
I added layoutAboutToBeChanged and layoutChanged signals to my insertRows method:
bool
ExclModel::insertRows(int row, int count, const QModelIndex & parent)
{
bool bRet=false;
if (parent.isValid())
{
// we always insert at the end...
cerr << "insertRows" << ", exclVec.size "<< exclVec.size() << endl;
emit layoutAboutToBeChanged();
beginInsertRows(parent,row,row+count-1);
int ii;
for (ii=0;ii<count;ii++)
{
exclItem itm;itm.strtT=0.0;itm.endT=0.0;
exclVec.push_back(itm);
}
cerr << "end insertRows" << ", exclVec.size "<< exclVec.size() << endl;
endInsertRows();
emit layoutChanged();
bRet=true;
}
return bRet;
}
AFAICT, the documentation does not mention this. I *think* it says you need those signals if you are doing sorting, but under the the insertRows method it says the following:
If you implement your own model, you can reimplement this function if you want to support insertions. Alternatively, you can provide your own API for altering the data. In either case, you will need to call beginInsertRows() and endInsertRows() to notify other components that the model has changed.
For clarity and naive dumb-asses like me, it should explicitly state the need for layout... signals.