Mercurial > projects > qtd
comparison examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.d @ 157:7c3067c2b803
small issues
author | mandel |
---|---|
date | Tue, 16 Jun 2009 21:31:04 +0000 |
parents | 22257add3152 |
children | 624b4a58556e |
comparison
equal
deleted
inserted
replaced
156:37cf6fd1ee85 | 157:7c3067c2b803 |
---|---|
86 { | 86 { |
87 QModelIndex index0 = sourceModel().index(sourceRow, 0, sourceParent); | 87 QModelIndex index0 = sourceModel().index(sourceRow, 0, sourceParent); |
88 QModelIndex index1 = sourceModel().index(sourceRow, 1, sourceParent); | 88 QModelIndex index1 = sourceModel().index(sourceRow, 1, sourceParent); |
89 QModelIndex index2 = sourceModel().index(sourceRow, 2, sourceParent); | 89 QModelIndex index2 = sourceModel().index(sourceRow, 2, sourceParent); |
90 | 90 |
91 static bool contains(char[] str, QRegExp rx) | 91 static bool contains(char[] str, QRegExp rx1) |
92 { | 92 { |
93 return (rx.indexIn(str, 0) != -1); | 93 auto rx2 = new QRegExp(rx1); |
94 return (rx2.indexIn(str, 0) != -1); | |
94 } | 95 } |
95 | 96 |
96 return (contains(sourceModel().data(index0).toString(), filterRegExp()) | 97 return (contains(sourceModel().data(index0).toString(), filterRegExp()) |
97 || contains(sourceModel().data(index1).toString(), filterRegExp())) | 98 || contains(sourceModel().data(index1).toString(), filterRegExp())) |
98 && dateInRange(sourceModel().data(index2).toDate()); | 99 && dateInRange(sourceModel().data(index2).toDate()); |