1 #ifndef SORTEDLIBRARY_H
2 #define SORTEDLIBRARY_H
4 #include <QSortFilterProxyModel>
8 /** Sorted library model. */
9 class SortedLibrary: public QSortFilterProxyModel
14 enum SortBy {SortByTitle, SortByAuthor};
15 explicit SortedLibrary(QObject *parent = 0);
16 bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
17 void setSortBy(SortBy key);
25 int compareBy(SortBy key, Book *left, Book *right) const;
31 #endif // SORTEDLIBRARY_H