summaryrefslogtreecommitdiffstats
path: root/CategorizedProxyModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CategorizedProxyModel.cpp')
-rw-r--r--CategorizedProxyModel.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/CategorizedProxyModel.cpp b/CategorizedProxyModel.cpp
new file mode 100644
index 00000000..2b54ce1b
--- /dev/null
+++ b/CategorizedProxyModel.cpp
@@ -0,0 +1,12 @@
+#include "CategorizedProxyModel.h"
+
+#include "CategorizedView.h"
+
+CategorizedProxyModel::CategorizedProxyModel(QObject *parent)
+ : QSortFilterProxyModel(parent)
+{
+}
+bool CategorizedProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
+{
+ return left.data(CategorizedView::CategoryRole).toString() < right.data(CategorizedView::CategoryRole).toString();
+}