This patch fixes another assert in the classmodel.
This time it is the assert triggered from
Node::~Node -> ClassModel::nodesAboutToBeRemoved -> QAbstractItemModel::beginRemoveRows(index, first, last)
last > rowCount(), last was greater than the rowCount.
This is because in Node::removeNode the child was first removed from the childrenlist and then deleted.
But createIndex() & rowCount() rely on the item to still be in the model/list. Node::row() would simply return -1 which would result in an invalid index.
rowCount for invalid index < last Item
The solution is simple, like in Node::clear(), first delete the item and then remove it from the list.