summaryrefslogtreecommitdiffstats
path: root/smtreemodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-06-18 15:52:01 +0200
committerArno <am@disconnect.de>2010-06-18 15:52:01 +0200
commitb153f90a4c7f76a5ce5f4985bdbd687ba1602fdb (patch)
tree7e2bfc14e62e24b56a77b3afd2e40003956fb49d /smtreemodel.cpp
parenta8bd9a2310bd630dd4e72fe0ff54a8be17e80064 (diff)
downloadSheMov-b153f90a4c7f76a5ce5f4985bdbd687ba1602fdb.tar.gz
SheMov-b153f90a4c7f76a5ce5f4985bdbd687ba1602fdb.tar.bz2
SheMov-b153f90a4c7f76a5ce5f4985bdbd687ba1602fdb.zip
Created frontend for SeriesTreeModel::deleteFromSeries
Implemented frontend for SeriesTreeModel::deleteFromSeries. I hope QPersistentModelIndexes work as advertised. From the qt-sources it seems that a QPersistentModelIndex is automatically updated by QAbstractItemModel when calling begin(Remove|Insert)Rows. Testing worked out fine. While at it I found a bug in SmTreeModel. removeRows has to be called with (i - 1) instead of (i) to remove the correct nodes.
Diffstat (limited to 'smtreemodel.cpp')
-rw-r--r--smtreemodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/smtreemodel.cpp b/smtreemodel.cpp
index 227c1cb..2a230cc 100644
--- a/smtreemodel.cpp
+++ b/smtreemodel.cpp
@@ -153,7 +153,7 @@ bool SmTreeModel::removeRows(int row, int count, const QModelIndex &parent){
beginRemoveRows(parent, row, row + count - 1);
for(int i = row + count; i > row; --i){
- retval = parentItem->removeChild(i);
+ retval = parentItem->removeChild(i - 1);
}
endRemoveRows();