summaryrefslogtreecommitdiffstats
path: root/seriestreemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'seriestreemodel.cpp')
-rw-r--r--seriestreemodel.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/seriestreemodel.cpp b/seriestreemodel.cpp
index ab3fe8c..a2bde55 100644
--- a/seriestreemodel.cpp
+++ b/seriestreemodel.cpp
@@ -164,15 +164,19 @@ QList<QVariant> SeriesTreeModel::childrenColumnList(const QModelIndex &parent, i
return retval;
}
-QModelIndex SeriesTreeModel::findValue(const QVariant &value, const QModelIndex &parent, int column) const{
+QModelIndex SeriesTreeModel::findValue(const QVariant &value, const QModelIndex &parent, int searchColumn, int indexColumn) const{
SmTreeItem *parentItem = root();
if(parent != QModelIndex()){
parentItem = static_cast<SmTreeItem*>(parent.internalPointer());
}
for(int i = 0; i < parentItem->childCount(); ++i){
SmTreeItem *childItem = parentItem->child(i);
- if(value == childItem->data(column)){
- return createIndex(i, column, childItem);
+ if(value == childItem->data(searchColumn)){
+ if(indexColumn == -1){
+ return createIndex(i, searchColumn, childItem);
+ }else{
+ return createIndex(i, indexColumn, childItem);
+ }
}
}
return QModelIndex();