Loads of stuff, amongst others d&d and many bug fixes

This commit is contained in:
Jan Dalheimer
2013-12-26 21:16:03 +01:00
parent ccbf341dc8
commit 525f508d94
3 changed files with 568 additions and 175 deletions

View File

@@ -8,5 +8,14 @@ CategorizedProxyModel::CategorizedProxyModel(QObject *parent)
}
bool CategorizedProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
{
return left.data(CategorizedView::CategoryRole).toString() < right.data(CategorizedView::CategoryRole).toString();
const QString leftCategory = left.data(CategorizedView::CategoryRole).toString();
const QString rightCategory = right.data(CategorizedView::CategoryRole).toString();
if (leftCategory == rightCategory)
{
return left.row() < right.row();
}
else
{
return leftCategory < rightCategory;
}
}