From e2d4843586d84da62e325d1cb0025a795b162c1c Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 6 Oct 2012 11:02:42 +0200 Subject: More fixes to MappingTreeModel Fix move, addChild and such. Rename Fields and Roles to more speaking names, but that revealed a much deeper bug: the ParentID isn't really the parent_id, but the mapping_id. That could explain a lot. Nevertheless, it's still faster to repopulate the model after moving oder adding children instead of calling removeRows and insertRows. Another non-working commit... :( --- mappingtreewidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mappingtreewidget.cpp') diff --git a/mappingtreewidget.cpp b/mappingtreewidget.cpp index 1897cf1..0951312 100644 --- a/mappingtreewidget.cpp +++ b/mappingtreewidget.cpp @@ -221,7 +221,7 @@ void MappingTreeWidget::editChild(){ void MappingTreeWidget::selectionChanged(){ QModelIndex sel = selected(); QModelIndex real = mProxy->mapToSource(sel); - emit mappingChanged(real.data(MappingTreeModel::MapParentIdRole).toInt()); + emit mappingChanged(real.data(MappingTreeModel::MyIdRole).toInt()); } void MappingTreeWidget::moveChild(){ -- cgit v1.2.3-70-g09d2