Mercurial > projects > qtd
diff examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.d @ 160:624b4a58556e
fix sorting
author | mandel |
---|---|
date | Wed, 17 Jun 2009 17:42:02 +0000 |
parents | 7c3067c2b803 |
children | 71101646ab25 |
line wrap: on
line diff
--- a/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.d Wed Jun 17 15:34:57 2009 +0000 +++ b/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.d Wed Jun 17 17:42:02 2009 +0000 @@ -99,13 +99,12 @@ && dateInRange(sourceModel().data(index2).toDate()); } - bool lessThan(QModelIndex left, QModelIndex right) { QVariant leftData = sourceModel().data(left); QVariant rightData = sourceModel().data(right); - if (leftData.canConvert!(QDateTime)) { + if (leftData.type() == QVariant.Type.DateTime) { return leftData.toDateTime() < rightData.toDateTime(); } else { QRegExp emailPattern = new QRegExp("([\\w\\.]*@[\\w\\.]*)");