diff options
Diffstat (limited to 'smtreemodel.cpp')
-rw-r--r-- | smtreemodel.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/smtreemodel.cpp b/smtreemodel.cpp index 4f8ffdc..6abc999 100644 --- a/smtreemodel.cpp +++ b/smtreemodel.cpp @@ -272,6 +272,15 @@ bool SmTreeModel::addRow(const QList<QVariant> &data, const QModelIndex &parent, return false; } +bool SmTreeModel::appendRow(const QList<QVariant> &data, const QModelIndex &parent){ + SmTreeItem *pItem = itemAt(parent); + SmTreeItem *newItem = new SmTreeItem(data, pItem); + beginResetModel(); + pItem->appendChild(newItem); + endResetModel(); + return true; +} + SmTreeItem *SmTreeModel::itemAt(const QModelIndex &index) const{ if(index.isValid()){ SmTreeItem *item = static_cast<SmTreeItem*>(index.internalPointer()); |