I have a doubt with canFetch() and fetchMore() functions. i am implementing tree structure, when i scroll till the end canfetch() will be call and if returns true fetchMore() will be called where we have to fetch the data and insert items into tree.
void model::fetchMore(const QModelIndex& f_parent)
{
//fetch the data needed and create items
beginInsertRows(f_parent, row, lastRow);
endInsertRows();
}
Please let me know In beginInsertRows, what numbers exactly we need to specify, It is confusing me..
I have fetched some data now, in that from top I have 5 child's and followed by 10 parents and each parent has 10 child's. (f_parent parent has 5 childs already)
Now I need to insert 5 more children followed by 10 parents.
now what numbers I need to specify in beginInsertRows() exactly.
- beginInsertRows(f_parent,5,f_parent.row()+10); ?
- beginInsertRows(f_parent,f_parent.row(),f_parent.row()+10); ?
- beginInsertRows(f_parent,5,10); ?