From 8b0aca608140c72fb7d60f7b821f78a86848a70a Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 2 Mar 2012 20:57:55 +0100 Subject: Make add mapping item a context menu entry Remove the QLineEdit and QPushButtons from the bottom of MappingTreeWidget and make adding mapping items available in the context menu. --- mappingtreemodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mappingtreemodel.cpp') 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); } -- cgit v1.2.3-70-g09d2