diff options
author | Arno <am@disconnect.de> | 2012-03-02 20:57:55 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2012-03-02 20:57:55 +0100 |
commit | 8b0aca608140c72fb7d60f7b821f78a86848a70a (patch) | |
tree | a6bf1ccef9f4b2021e92695c7459ae72859a86b7 /mappingtreemodel.cpp | |
parent | 6e03469151a2a3eae6e54dd1e138a2628d51eab3 (diff) | |
download | SheMov-8b0aca608140c72fb7d60f7b821f78a86848a70a.tar.gz SheMov-8b0aca608140c72fb7d60f7b821f78a86848a70a.tar.bz2 SheMov-8b0aca608140c72fb7d60f7b821f78a86848a70a.zip |
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.
Diffstat (limited to 'mappingtreemodel.cpp')
-rw-r--r-- | mappingtreemodel.cpp | 4 |
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); } |