summaryrefslogtreecommitdiffstats
path: root/smtreemodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2011-08-23 16:35:44 +0200
committerArno <am@disconnect.de>2011-08-23 16:35:44 +0200
commitb0ed5d04a5934be074383541026d49afc0804adb (patch)
treef60416e4cde15fce91cc7fecad5f73fa4e0a222e /smtreemodel.cpp
parent50783b0819531087266c626fa6066e8233bb0692 (diff)
downloadSheMov-b0ed5d04a5934be074383541026d49afc0804adb.tar.gz
SheMov-b0ed5d04a5934be074383541026d49afc0804adb.tar.bz2
SheMov-b0ed5d04a5934be074383541026d49afc0804adb.zip
Hmm, checking out treemodel again. This seems way too complex...
Diffstat (limited to 'smtreemodel.cpp')
-rw-r--r--smtreemodel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/smtreemodel.cpp b/smtreemodel.cpp
index 743e8be..50a55d0 100644
--- a/smtreemodel.cpp
+++ b/smtreemodel.cpp
@@ -139,7 +139,8 @@ QModelIndex SmTreeModel::find(const QVariant &value, int column, const QModelInd
QModelIndex SmTreeModel::findRecursive(const QVariant &value, int column, const QModelIndex &parent) const{
SmTreeItem *parentItem = 0;
if(!parent.isValid()){
- return QModelIndex();
+ //return QModelIndex();
+ parentItem = mRootItem;
}else{
parentItem = static_cast<SmTreeItem*>(parent.internalPointer());
}
@@ -153,6 +154,9 @@ QModelIndex SmTreeModel::findRecursive(const QVariant &value, int column, const
}
}
QModelIndex next = index(parent.row() + 1, column, parent.parent());
+ if(!next.isValid()){
+ return QModelIndex();
+ }
return findRecursive(value, column, next);
}