summaryrefslogtreecommitdiffstats
path: root/mappingtreemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mappingtreemodel.cpp')
-rw-r--r--mappingtreemodel.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/mappingtreemodel.cpp b/mappingtreemodel.cpp
index 3dabe16..8651a4a 100644
--- a/mappingtreemodel.cpp
+++ b/mappingtreemodel.cpp
@@ -226,7 +226,9 @@ bool MappingTreeModel::addChild(const QVariant &name, const QModelIndex &parent)
int where = lowerBound(pItem, mSelectChildQ->value(1), Name);
if(insertRows(where, 1, parent)){
QModelIndex newIdx = index(where, 0, parent);
- setData(newIdx, mSelectChildQ->value(1), NameRole);
+ if(!setData(newIdx, mSelectChildQ->value(1), NameRole)){
+ return false;
+ }
setData(newIdx, mSelectChildQ->value(0), IdRole);
setData(newIdx, mSelectChildQ->value(2), AddedRole);
}