Changeset View
Changeset View
Standalone View
Standalone View
kcms/cursortheme/xcursor/sortproxymodel.cpp
Show All 15 Lines | |||||
16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include <QString> | 20 | #include <QString> | ||
21 | #include "sortproxymodel.h" | 21 | #include "sortproxymodel.h" | ||
22 | #include "cursortheme.h" | 22 | #include "cursortheme.h" | ||
23 | 23 | | |||
24 | QHash<int, QByteArray> SortProxyModel::roleNames() const | ||||
25 | { | ||||
26 | QHash<int, QByteArray> roleNames = QSortFilterProxyModel::roleNames(); | ||||
27 | roleNames[CursorTheme::DisplayDetailRole] = "description"; | ||||
28 | | ||||
29 | return roleNames; | ||||
30 | } | ||||
24 | 31 | | |||
25 | int SortProxyModel::compare(const QModelIndex &left, const QModelIndex &right, int role) const | 32 | int SortProxyModel::compare(const QModelIndex &left, const QModelIndex &right, int role) const | ||
26 | { | 33 | { | ||
27 | const QAbstractItemModel *model = sourceModel(); | 34 | const QAbstractItemModel *model = sourceModel(); | ||
28 | 35 | | |||
29 | QString first = model->data(left, role).toString(); | 36 | QString first = model->data(left, role).toString(); | ||
30 | QString second = model->data(right, role).toString(); | 37 | QString second = model->data(right, role).toString(); | ||
31 | 38 | | |||
Show All 19 Lines |