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();
}
void model::fetchMore(const QModelIndex& f_parent)
{
//fetch the data needed and create items
beginInsertRows(f_parent, row, lastRow);
endInsertRows();
}
To copy to clipboard, switch view to plain text mode
Please let me know In beginInsertRows, what parameters exactly we need to specify, It is confusing me..
I have fetched some data now, where I have 5 child's (previous data has remaining 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.
please let me know, what parameters I need to specify in beginInsertRows() exactly.
beginInsertRows(f_parent,5,f_parent.row()+10); ?
beginInsertRows(f_parent,f_parent.row(),f_parent.r ow()+10); ?
beginInsertRows(f_parent,5,10); ?
Documentation explained more in terms of list only(per this particular function) rather than tree.
Bookmarks