insertRow(rowCount(parentIndex), parentIndex);
QModelIndex ind
= index
(rowCount
(parentIndex
), column, parentIndex
);
setData(ind, "value");
insertRow(rowCount(parentIndex), parentIndex);
QModelIndex ind = index(rowCount(parentIndex), column, parentIndex);
setData(ind, "value");
To copy to clipboard, switch view to plain text mode
where parentIndex is the model index of the parent you wish to add a child for. "Under the hood" you have to implement it as a simple modification to your internal data structures and you can see in the simpletreemodel example how to do it (just look at its code, not the app itself - the model is initialised on startup).
Bookmarks