Mercurial > projects > qtd
comparison examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.d @ 213:26036621830e
more D2 examples fixes
author | SokoL_SD |
---|---|
date | Tue, 14 Jul 2009 13:22:48 +0000 |
parents | 71101646ab25 |
children | 7a3c43424dca |
comparison
equal
deleted
inserted
replaced
212:bc1525b955d8 | 213:26036621830e |
---|---|
80 invalidateFilter(); | 80 invalidateFilter(); |
81 } | 81 } |
82 | 82 |
83 protected: | 83 protected: |
84 | 84 |
85 bool filterAcceptsRow(int sourceRow, QModelIndex sourceParent) | 85 override bool filterAcceptsRow(int sourceRow, const QModelIndex sourceParent) |
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 |
97 return (contains(sourceModel().data(index0).toString(), filterRegExp()) | 97 return (contains(sourceModel().data(index0).toString(), filterRegExp()) |
98 || contains(sourceModel().data(index1).toString(), filterRegExp())) | 98 || contains(sourceModel().data(index1).toString(), filterRegExp())) |
99 && dateInRange(sourceModel().data(index2).toDate()); | 99 && dateInRange(sourceModel().data(index2).toDate()); |
100 } | 100 } |
101 | 101 |
102 bool lessThan(QModelIndex left, QModelIndex right) | 102 override bool lessThan(const QModelIndex left, const QModelIndex right) |
103 { | 103 { |
104 QVariant leftData = sourceModel().data(left); | 104 QVariant leftData = sourceModel().data(left); |
105 QVariant rightData = sourceModel().data(right); | 105 QVariant rightData = sourceModel().data(right); |
106 | 106 |
107 if (leftData.type() == QVariant.Type.DateTime) { | 107 if (leftData.type() == QVariant.Type.DateTime) { |