summaryrefslogtreecommitdiffstats
path: root/CategorizedProxyModel.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2013-12-24 11:47:30 +0100
committerJan Dalheimer <jan@dalheimer.de>2013-12-24 11:47:30 +0100
commitccbf341dc8d8e515d9cf918bff7ff9435c477847 (patch)
tree7ca5071ba6dcc52dd6e77e265ece4afafcac58f7 /CategorizedProxyModel.cpp
downloadMultiMC-ccbf341dc8d8e515d9cf918bff7ff9435c477847.tar
MultiMC-ccbf341dc8d8e515d9cf918bff7ff9435c477847.tar.gz
MultiMC-ccbf341dc8d8e515d9cf918bff7ff9435c477847.tar.lz
MultiMC-ccbf341dc8d8e515d9cf918bff7ff9435c477847.tar.xz
MultiMC-ccbf341dc8d8e515d9cf918bff7ff9435c477847.zip
Initial commit. Basics work. Next: Drag and Drop
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();
+}