I have an abstractTable model with a very odd problem.
The rowCount method;
int ordersModel::rowCount(const QModelIndex &) const
{
int i = oData->count();
qDebug() << "rowc=" << i;
return 711;
// return oData->count();
}
Works when I hard code the value (711 or something lower) but if I use return i; or return oData->count(); the table displays nothing. (qDebug() reports that the data has 711 entries.
The headers appear correctly. I'm in Qt 5.4.1, Windows 7.
Stumped!
ordersModel
? Have you tried to find const 711 in other files (may it is hard coded somewhere else)? - IlyaoData
have any items when you assign it to the item view? If you add items after assigning it to the view, you must run thebeginInsertRows
andendInsertRows
functions to force the view to recheck the data. - RobbieE