Qt 实现树时,要传递给beginInsertRows()的参数。
我对canFetch()和fetchMore()函数有疑问。 我正在实现树结构,当我滚动到末尾时,将调用canfetch(),如果返回true,则将调用fetchMore(),其中我们必须获取数据并将项目插入树中Qt 实现树时,要传递给beginInsertRows()的参数。,qt,qtreeview,qstandarditemmodel,Qt,Qtreeview,Qstandarditemmodel,我对canFetch()和fetchMore()函数有疑问。 我正在实现树结构,当我滚动到末尾时,将调用canfetch(),如果返回true,则将调用fetchMore(),其中我们必须获取数据并将项目插入树中 void model::fetchMore(const QModelIndex& f_parent) { //fetch the data needed and create items beginInsertRows(f_parent, row, lastRo
void model::fetchMore(const QModelIndex& f_parent)
{
//fetch the data needed and create items
beginInsertRows(f_parent, row, lastRow);
endInsertRows();
}
请在beginInsertRows中告诉我,我们到底需要指定哪些数字,这让我很困惑
我现在已经获取了一些数据,从上面我有5个孩子的,然后是10个家长,每个家长有10个孩子的。(f_父母已经有5个孩子)
现在我需要再插入5个孩子和10个家长
现在,我需要在beginInsertRows()中准确指定哪些数字
- beginInsertRows(f_parent,5,f_parent.row()+10)李>
- beginInsertRows(f_parent,f_parent.row(),f_parent.row()+10)李>
- beginInsertRows(f_父,5,10)李>
beginInsertRows
。每个家长一次,每批孩子一次。