I have already inserted 20 parents each parent has 10 children except last one has 5 child's, in fetchMore() method I have fetched 5 child's (remaining 5 child's for the last parent) and 10 more parents and all 10 parents have 10 child's again.
Now i need to insert 5 child's followed by 10 parents each with 10 child's.
void model::fetchMore(const QModelIndex& f_parent)
{
//fetch the data : I fetched 5 child's followed by 10 parents each with 10 childs
//apend 5 childs to the parent
beginInsertRows(f_parent, 5, 9);
endInsertRows();
//then append remaining 10 parents
beginInsertRows(parent index of f_parent, f_parent.row(), f_parent.row()+9);
endInsertRows();
}
void model::fetchMore(const QModelIndex& f_parent)
{
//fetch the data : I fetched 5 child's followed by 10 parents each with 10 childs
//apend 5 childs to the parent
beginInsertRows(f_parent, 5, 9);
endInsertRows();
//then append remaining 10 parents
beginInsertRows(parent index of f_parent, f_parent.row(), f_parent.row()+9);
endInsertRows();
}
To copy to clipboard, switch view to plain text mode
Thanks.
Bookmarks