From b0ed5d04a5934be074383541026d49afc0804adb Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 23 Aug 2011 16:35:44 +0200 Subject: Hmm, checking out treemodel again. This seems way too complex... --- smtreemodel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'smtreemodel.cpp') 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(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); } -- cgit v1.2.3-70-g09d2