KDEUI
kcategorizedsortfilterproxymodel.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KCATEGORIZEDSORTFILTERPROXYMODEL_H
00023 #define KCATEGORIZEDSORTFILTERPROXYMODEL_H
00024
00025 #include <QtGui/QSortFilterProxyModel>
00026
00027 #include <kdeui_export.h>
00028
00029 class QItemSelection;
00030
00031
00045 class KDEUI_EXPORT KCategorizedSortFilterProxyModel
00046 : public QSortFilterProxyModel
00047 {
00048 public:
00049 enum AdditionalRoles {
00050
00051
00052 CategoryDisplayRole = 0x17CE990A,
00053
00054 CategorySortRole = 0x27857E60
00055
00056
00057
00058
00059
00060 };
00061
00062 KCategorizedSortFilterProxyModel(QObject *parent = 0);
00063 virtual ~KCategorizedSortFilterProxyModel();
00064
00069 virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
00070
00074 bool isCategorizedModel() const;
00075
00081 void setCategorizedModel(bool categorizedModel);
00082
00086 int sortColumn() const;
00087
00091 Qt::SortOrder sortOrder() const;
00092
00100 void setSortCategoriesByNaturalComparison(bool sortCategoriesByNaturalComparison);
00101
00105 bool sortCategoriesByNaturalComparison() const;
00106
00114 KDE_DEPRECATED static int naturalCompare(const QString &a, const QString &b);
00115
00116 protected:
00130 virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
00131
00138 virtual bool subSortLessThan(const QModelIndex &left, const QModelIndex &right) const;
00139
00175 virtual int compareCategories(const QModelIndex &left, const QModelIndex &right) const;
00176
00177 private:
00178 class Private;
00179 Private *const d;
00180 };
00181
00182
00183 #endif // KCATEGORIZEDSORTFILTERPROXYMODEL_H