Hello!
I've created my own model, that bases on Blanchet-Summerfield methon from all-known book.
So, I have an Node object. Every Node has a pointer to parent node and a list of child node. Model has the "main Root Node", which parent == 0 ad child are the needed model's nodes.
The "main Root Node" doesn't appear in view, only its nodes:
Qt Code:
  1. RootNode - invisiple
  2. --Node1
  3. ----Node1.1
  4. ----Node1.2
  5. --Node2
  6. --Node3
To copy to clipboard, switch view to plain text mode 

At first time I fill this model by data using beginResetModel and endResetModel functions.
But there are cases, when I want to add a few nodes into the model, but don't want to reset it whole. Additionaly, I use a proxy sorting model.

Reading Qt help I see that I should use beginInsertRows and endInsertRows functions. The problem is that functions have a QModelIndex parameter - parent node.
I don't use QModelIndex at all!
To know node class from QModelIndex presented I use this construction, as written in the book:
Qt Code:
  1. tUMClientsNode *lNode = static_cast<tUMClientsNode*>(aParent.internalPointer());
To copy to clipboard, switch view to plain text mode 
tUMClientsNode - my node class, aParent - QModelIndex.

What should I do to get QModelIndex from my Node? How to use beginInsertRows correctly?

To add a single item I use similar code now:
Qt Code:
  1. void tUMClientsModel::AddNewClient(tUMDCClientInfo &aNewClient, bool aUseBeginInsert)
  2. {
  3. if (aNewClient.fClientParentID == 0)
  4. fRootNode->fChildrenList.append(new tUMClientsNode(fRootNode, aNewClient));
  5. else
  6. for (int i = 0; i < fRootNode->fChildrenList.count(); i++)
  7. if (fRootNode->fChildrenList[i]->fClientInfo.fClientID == aNewClient.fClientParentID)
  8. {
  9. fRootNode->fChildrenList[i]->fChildrenList.append(
  10. new tUMClientsNode(fRootNode->fChildrenList[i], aNewClient)
  11. );
  12. break;
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

Thank you!