From d73a297c2daed1b70625d19a70cee48db192956f Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 8 Jul 2014 11:26:39 +0200 Subject: Fix MappingTreeResultModel for good removeRows and insertRows is buggy. Unfortunately I can't figure out how... So make it easy and reset the model on inserts and removals. --- mappingtreewidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mappingtreewidget.cpp') diff --git a/mappingtreewidget.cpp b/mappingtreewidget.cpp index b56dd48..6497cbd 100644 --- a/mappingtreewidget.cpp +++ b/mappingtreewidget.cpp @@ -331,10 +331,9 @@ void MappingEditWidget::removeMapping(){ } QModelIndex firstIdx = sel.first(); if(firstIdx.isValid()){ - int row = firstIdx.row(); - QModelIndex p = firstIdx.parent(); - mResultModel->removeRows(row, 1, p); + mResultModel->removeItem(firstIdx); } + mMappingResult->expandAll(); } void MappingEditWidget::setMappings(const QList &mappings){ -- cgit v1.2.3-70-g09d2