diff options
Diffstat (limited to 'smtreemodel.cpp')
-rw-r--r-- | smtreemodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/smtreemodel.cpp b/smtreemodel.cpp index 292ed20..227c1cb 100644 --- a/smtreemodel.cpp +++ b/smtreemodel.cpp @@ -168,7 +168,7 @@ bool SmTreeModel::addRow(const QList<QVariant> &data, const QModelIndex &parent) SmTreeItem *parentItem = itemAt(parent); if(insertRows(parentItem->childCount(), 1, parent)){ - SmTreeItem *child = parentItem->child(parentItem->childCount()); + SmTreeItem *child = parentItem->child(parentItem->childCount() - 1); delete child; SmTreeItem *newChild = new SmTreeItem(data, parentItem); child = newChild; |